In some of the programming languages, typically c , c++ , and java , the integer data types are int
, , short
and long
. The data type int
is usually 32 bits. The data type short
is typically smaller than the data type int
and the data type long
is typically larger than the data type int
.
The first bit of an integer data type is the sign bit . A negative number starts with '1' and a non-negative number starts with '0'.
Therefore, a 32-bit data type typically stores numbers in the range -(2^31)
a (2^31 - 1)
.
- Why can't we have a data type of unlimited size, so that we can store an unlimited range of numbers?