posted 20 years ago
As "1" is Type int, it is assign 32 bit as default.
So, if the shift bit is greater than or equal to 32, it will be "mod"ed.
As a result, if it is 33, then it become 33 mod 32 = 1 (shift 1 bit),
shift 34 means 34 mod 32 = 2 (shift 2 bit as result).
As show below,
for case 1, shift 31, means to add 31 signed bit (0) in the left.
for case 2, 32 mod 32 = 0, it finally shift 0, that means unchanged.
for case 3, 33 mod 32 = 1, it means shift 1 right, so it gets to 0.