On 25/08/2018 05:45, Eric S Fraga wrote:
On Friday, 24 Aug 2018 at 20:15, Reco wrote:
-INT_MAX. I win.
-1 (wraps around so = INT_MAX) and I win!

No, it is the other way around for two's complement:

INT_MIN = -INT_MAX - 1

Two's complement is unbalanced. You do not know the power of the dark (negative) side.

For example, for signed 32-bit integers using two's complement (C/C++ int on most current architectures and JVM int).

INT_MAX = 2**31 - 1 = 2147483647

INT_MIN = -2**31 = -2147483648

https://en.wikipedia.org/wiki/Integer_(computer_science)

Kind regards,

--
Ben Caradoc-Davies <b...@transient.nz>
Director
Transient Software Limited <https://transient.nz/>
New Zealand

Reply via email to