im trying to translate this code to python, but im having a hard time doing so, don\'t worry about the index values and variable names, I just want to know what the \">>>\" part
It's an "unsigned right shift".
So, if your number (x
) is 11110000
(in binary).
x >>> 1
will be 01111000
(in binary).
This is opposed to x >> 1
which will result in 11111000
(in binary).
The >>
tries to preserve the "sign bit" but the >>>
does not.
Note: I've assumed a 8-bit integer (or a byte
in Java). The same thing holds for 2-byte and 4-byte integers.