[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Integer Numbers from -32768 to 32767 Ordinal Type
The data type Integer represents whole numbers (42, 0, -221). Standard
Pascal requires a predefined constant MaxInt that specifies the
maximum positive integer value allowed by the compiler. Negative
values to (at least) -MaxInt must then also be allowed; some
implementations allow -MaxInt-1, because of the use of two's
complement notation.
Integers in Turbo Pascal occupy two bytes, with the least significant
(lower) byte stored first. Negative numbers are represented using
two's complement notation. MaxInt = 32767, while the negative limit is
-32768. Wraparound does occur, regardless of range checking, so that
the expression MaxInt+1 yields -(MaxInt+1).
Turbo Pascal allows you to specify integer constants in hexadecimal
(base 16) notation by preceding the number with a dollar sign ($). The
decimal value 1024 can be written as $0400, while -1 is $FFFF.
-------------------------------- Example ---------------------------------
var
Iota,Able,Fred : Integer;
begin
Iota := 32;
Able := -32198;
Fred := $807F;
end.
See Also:
Real
Byte
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson