54
The following examples illustrate the successive steps
in
the
evaluation of four arith-
metic expressions according
to
the rules just described.
In
each expression,
the
vari-
ables A,
B,
and C have been assigned the integer values 4, 6, and 2, respectively.
Expression
-At2+B/C*2.5
(-At2)+B/C*2.5
-At(2+B/C)*2.5
-At((2+B)/C)*2.5
Character Expressions
Evaluation and Result .
-4t2+6/2*2.5
- 16 +6/2*2.5
-16
+6/2*2.5
-16
+3
*2.5
-16
+ 7.5
-8.5
(-4t2)+6/2 *2.5
- 16 +6/2*2.5
-16
+6/2*2.5
-16
+3 *2.5
-16
+ 7.5
-8.5
-4t(2+6/2)*2.5
-4t(2+3) *2.5
-4t5
*2.5
- 1024 *2.5
-1024 *2.5
-2560
-4t((2+6)/2)*2.5
-4t
(8/2) *2.5
-4t4
*2.5
- 256 *2.5
-256 *2.5
-640
A character expression
is
a character constant, a character variable, a single element
of
a character array,
or
a substring (STR) function. The only operators ever asso-
ciated with character expressions are the relational operators described next. The
following are examples
of
valid character expressions:
D$(4)
A$
STR(A$,1,3)=B$
(
'\
, i
~