5.7.2 Integer Variables
An integer variable is a named location that stores a whole
number. The storage space required to hold the value de-
pends on the variable's INTEGER subtype. For example,
each BYTE integer variable requires 8 bits (1 byte) of storage,
while each LONG integer variable requires 32 bits (4 bytes)
of storage.
If you assign a floating-point value to an integer variable, the
fractional portion of the value is trunctated; it does not round
to the nearest integer. In the following example, the value -5
is assigned to the integer variable, not -6.
B% = -5.7
Although the integer data types LONG, WORD, and BYTE
allow the minimum values -2147483648, -32768, and -128,
respectively, you cannot use these constants explicitly, because
BASIC reports an integer overflow error while attempting
to parse the literal constant. To use these values, you must
use either radix notation, such as -``32768''L, or a constant
expression. For example:
DECLARE WORD CONSTANT Word_const = -32767 - 1