posted 22 years ago
In binary,
i = 0111 1111 1111 1111 1111 1111 1111 1111 (you can verify, this add up to 2147483647)
j = i * 2
= 1111 1111 1111 1111 1111 1111 1111 1110
First bite is 1, so j is negative.
| j | = 0000 0000 0000 0000 0000 0000 0000 0010
so j = -2