Why has the int32 type a maximum value of 2³¹ − 1? [duplicate]

Possible Duplicate:
What is “2’s Complement”?

I know int32 has a length of 32 bits (4 bytes). I assume it has 2³² values but as half of them must be under zero, I guess it has something to do with this. I would like to know why exactly int32 has max. positive number 2³¹ − 1.

Leave a Comment