posted 19 years ago
It goes like this :
If you have a +ve number and every time you shift rightgives you a number equivalent to integer division by 2.
ie 4 >> 1 gives(4/2)ie 2, 4 >> 2 gives(4/4) ie 1.
if you do it 32 times right shift gives you the same number ie 4.
ie any multiple of 32(0, 32, 64, 128) also gives you the same number ie 4.
Any number(say n ) above 32, 64, 128..... times shifting gives you (n-32) times right shift.
So 33 means shift (33-32) ie 1. equivalent 4 >> 33 is 4 >> 1.
So 34 means shift (34-32) ie 2. equivalent 4 >> 34 is 4 >> 2.
Simillarly in case of -ve numbers, the sign bit is always 1 and it is stored as 2's complement form.
So shifting more than 2 times -4 ( ie -4 >> 3 ) gives you -1(not zero). other rules being same.
ie -4 >> 32 = -4
-4 >> 64 = -4
-4 >> 33 is -4 >> 1 = -2
not sure about >>> ???
Not everything that counts can be counted, and not everything that can be counted counts.