Originally posted by Karthik Rajashekaran:
... But for the following
how can findout the result please help me
any formula to calculate it
..
1<<67 yields 8
1<<99 yields 8
For int shifts, only the last 5 bits of the right operand are used, so the amount of the shift is always between 0 and 31. (For long shifts, the last 6 bits are used, so the shift is between 0 and 63.)
So you can use modulus...
67%32 is 3. So 1<<67 = 1<<3 = 8.
99%32 is also 3, so 1<<99 = 3.