211k views
1 vote
What is the range of a 32-bit signed integer?

1 Answer

3 votes

Answer:

From -2147483647 to 2147483648.

Step-by-step explanation:

A 32 bit integer has 2^32 = 4294967296 possible values. A signed integer has positive and negative values as well as the zero.

Of these values (2^32)/2 will be positive, (2^32)/2 - 1 will be negative and one will be the zero.

Therefore the range is from -(2^32)/2 + 1 to (2^32)/2.

This can also be expressed as from -2147483647 to 2147483648.

User Calimarkus
by
5.4k points