I am pretty confused with this expression here. I am a Java programmer but I am not very well versed with bit manipulation.
I think I understand the below correctly:
Input : 1 << 10 Output: 0000000000000000000010000000000 For positive numbers, I think it is you move 1 by 10 bits.
The confusion is when I have the below:
int val = -10 (binary representation : 1111111111111111111111111110110 ) Input : 1 << val Output: 0000000010000000000000000000000 That would be really great if someone can explain me the meaning of left shifting or right shifting by negative number.