The bit shift operator does not actually divide by 2. Instead, it moves the bits of the number to the right by the number of positions specified on the right side. For example:
00101100 = 44 00010110 = 44 >> 1 = 22
Notice how the bits in the second line coincide with the line above, just shifted one place to the right. Now look at the second example:
00001011 = 11 00000101 = 11 >> 1 = 5
This is exactly the same operation as before. However, the result of 5 is due to the fact that the last bit is shifted to the right and disappears, creating the result of 5. Because of this behavior, the operator with the right shift will in general be equivalent to dividing by two and then discarding any remainder or decimal part.
JSB Υ±ΥΈΥ£ΥΉ
source share