Originally posted by Surekha Reddy:
Hi,
Lets take this example.
int i = 10;
i = i << 35;
here 35 is not in the range of 0 to 31. So we can use lower 5 bits to calculate the shift distance.
35 -- 0000 0000 0000 0000 0000 0000 0010 0011
Here lower 5 bits are -- 00011. This is 3 in decimal.
This means i = i << 35 is equivalant to i = i << 3.
Please correct me if i'm wrong.
Regards,
Surekha.
I think it should be:
i = i << 35; ---> i = i << (35%32); ---> i = i << 3;
There's nothing with the 5 lowest bits. Let me know if I am wrong. Thanks.