The bit representation of -1 is 11111111 11111111 11111111 11111111 >> is the signed right shift operator. That means that it shifts the bits to the right (the number of times according to the second operand) and preserves the sign of the integer during each shift. So, -1 >> anything is -1. All of the bits are 1's and are moved to the right, the left most bit being replaced by a new 1 during each shift. For a more thorough explanation of bit shifting, take a look at Cat and Mouse Games with Bits. Good Luck.