44
Arithmetic Constants
An arithmetic constant
is
either an integer, a fixed-point,
or
a floating-point number
whose value
is
never altered during execution
of
the
program. Thus,
the
integer 1
is
a constant
in
the
following statement:
x = X
+1
I nternal Constants
An internal constant
is
an arithmetic constant with a predefined value. Unlike normal
arithmetic constants, the internal constants are referred
to
by names,
though
like
normal arithmetic constants, their values are never altered during program execution.
The six internal constants are:
Constant
Name
Value
Pi
(1r)
&PI
3.
141592653590
Natural
log
&E
2.718281828459
Square root 0,('2
&SQR2
1.414213562373
/
/
Centimeters per inch
&INCM
2.540000000000
Kilograms per pound
&LBKG
0.453592370000
Liters pergallon
&GALI 3.785411784000
The internal constant names can only be used
as
parts
of
arithmetic expressions, and
can be preceded by a plus
or
minus sign, for example:
2*&PI (then press EXECUTE)
The result
is
6.283185.
Arithmetic Variables
A variable
is
a named data item whose value
is
subject
to
change during execution
of
the
program. Arithmetic variables are named by a single letter
of
the extended
alphabet (A-Z,
@,
#,
and $),
or
by a single letter
of
the
extended alphabet followed
by a single digit (0-9). Examples
of
arithmetic variable names are
A,
A5,
#1,
and
#7.
When a program
is
executed,
the
initial value
of
arithmetic variables
is
set
to
zero.
The only exception
is
that
variables assigned
in
a
USE
statement are
not
initialized
(see
USE,
Chapter 4) for a program
that
is
chained
to
(see CHAIN, Chapter 4).
"
-
./
(
/'
'
\,
/