Taking the binary code 0x80000000 , we get
1000 0000 0000 0000 0000 0000 0000 0000
How does this relate to -2147483648 . I got this question with this program.
class a { public static void main(String[] args) { int a = 0x80000000; System.out.printf("%x %d\n",a,a); } } meow@VikkyHacks :~/Arena/java$ java a 80000000 -2147483648
EDIT I found out that 2 additions are used to represent negative numbers. When I try to equate this to the fact that 1 addition will be
1 Comp. :: 0111 1111 1111 1111 1111 1111 1111 1111 2 Comp. :: 1000 0000 0000 0000 0000 0000 0000 0000
which again makes no sense, How 0x80000000 equates to -2147483648
java bits
vikkyhacks
source share