A =
12.345678901234!
BASIC classifies the constant as single precision, and shortens it
to seven digits. However, if you tell BASIC to print the value of
A,
only six digits are printed out:
12.3457
E Single-precision exponential format. The E indicates that the
constant is to be mUltiplied
by
a specific power of 10. For
example:
A =
1.2E5
stores the single-precision number 120000
in
A.
# Makes the number double precision. For example,
in
statement:
PR
I NT
3#/7
BASIC classifies the first constant
as
double precision before the
division takes place.
D Double-precision exponential format. The D indicates the
constant is to be multiplied
by
a specified power of 10. For
example, in:
A =
1.23456789D
- 1
the double-precision constant has the value 0.123456789.
How
BASIC
Classifies Variables
When BASIC encounters a variable name
in
the program, it classifies
it as either a string,
an
integer, a single-precision number, or a
double-precision number.
BASIC classifies all variable names as single-precision initially. For
example:
AB AMOUNT
Xy
L
are all single precision initially. If this is the first line of your program:
LP
=
1.2
BASIC classifies
LP
as a single-precision variable.
However, you may assign different attributes to variables by using
definition statements at the beginning of your program:
DEFINT - Defines variables as integer
DEFDBL - Defines variables as double-precision
DEFSTR - Defines variables as string
DEFSNG - Defines variables as single-precision. (Since BASIC
classifies
all
variables as single precision initially
2-34