2147483647 = 2^31...
The integer values in Java are 32-bit Two's complement encoded
numbers and the highest possible value for this system is
2,147,483,647. The value 2,147,483,648 or 2n-1 where n is 32 is
negated under two's complement representation and becomes the
-2n-1s place. It is the most significant bit, meaning it has the
greatest value. In Two's compliment the most significant bit is
becomes the "sign bit" and indicates the sign of the number. If the
sign bit is 0 then largest number that can be stored in the remaing
31 bits is (2n-1-1) or 232-1-1 = 231-1 = 2,147,483,648 -1 =
2,147,483,647. |