posted 20 years ago
If i had this:
but if I changed the i = i >> 31 to i = i >> 30, or 29 or anything, it is still -1 and if I change the int i to -2 or -3 it is still -1, I thought i understood how the bit-wise operator worked but how come it is like that? I must be very confused about the operator. I always thought that int was stored something like...
10000000....1 for -1, and 10000...10 for -2, but if that is the case then the >> operator is very different from what I think it should be doing?