1

So the max for an int is 2147483647, but the minimum is -2147483648, which has an absolute value 1 higher. Why is this? Is 0 counted as a positive number?

ptgflyer
  • 105
  • 4
  • 2
    Effectively, yes; it has a leading zero, so takes up one "slot" on the positive side. See e.g. https://en.wikipedia.org/wiki/Two%27s_complement – jonrsharpe Mar 21 '16 at 12:31
  • Why didn't you just post that as the answer and get credit for it? – ptgflyer Mar 21 '16 at 12:36
  • Sorry. I looked for the same question because I figured it was explained somewhere, but couldn't find it. – ptgflyer Mar 21 '16 at 12:41

0 Answers0