The result is -2. Why? [ January 04, 2003: Message edited by: sam huang ]
SCJP,SCWCD,SCBCD,MCSE
John Lee
Ranch Hand
Joined: Aug 05, 2001
Posts: 2545
posted
0
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