What does the >> operator do? For example, what does the following operation 10 >> 1 = 5 do?
>>
10 >> 1 = 5
It's the right bit shift operator, 'moves' all bits once to the right.
10 in binary is
1010
shifted to the right it turns to
0101
which is 5
2.1m questions
2.1m answers
60 comments
57.0k users