Chapter 51
Basic
Concepts
Single precision
numbers can be
a
maximum of 7 digits and may
have a decimal point. Single precision numbers must be in the
range to Sample single precision numbers are:
10.001 -200034 123.4567
If a single precision number is more than 7 digits, BASIC dis-
plays the number in scientific notation, or exponential format, in
the E form. For example:
1.74E 6.9838 1043-7
BASIC stores
a
single precision number in 4 bytes of memory.
Double precision
numbers can include a maximum
of
16 digits
and may have
a
decimal point. Double precision numbers have
the same range
as
single precision numbers. Sample double pre-
cision numbers are:
1010234567 -8.7777651010
If
a double precision number
is
more than 16 digits, BASIC dis-
plays the number in scientific notation, or exponential format, in
the D form. For example:
8.00100708D12 -6.7765499824D16
BASIC stores double precision numbers in
8
bytes of memory. Al-
though double precision numbers consume more memory, they
are the most exact.
Hexadecimal
numbers are the hexadecimal representation
of
dec-
imal numbers. They contain
1
to
4
digits and are preceded by
&H. The hexadecimal numbers are 0,
1,
2,
3,
4,
5, 6, 7,
8,
9, A,
B, C, D, E, and F. Here are some hexadecimal numbers and
their decimal equivalents:
Hex Decimal
&H76
118
&H02FF
767
&HFF 255
BASIC stores hexadecimal numbers as integers.
45