In Borland Pascal and Free Pascal, an Integer has 16 bits and it is signed. This means we interpret the most significant bit to know if the number is negative or not.
The largest value that can be represented is
, which
is
, or 32767. The smallest value that can be represented is
. If you take the two's complement, it is still
. This means the smallest value is
or -32768.
In general, given
bits to represent a signed integer, the largest
value that can be presented is
, whereas the smallest value
is