Vector Basic Interpreter Basic 80 Reference Manual - page 181
of
190
I%=20000
J%=-18000
K%=20000
M%aI%+J%+K%
could produce an incorrect result when run.
If the compiler
actu~lly
performs
the
arithmetic
in
the order shown, no
overflow occurs.
However, if the
compiler
performs
I%+K%
first
and
then
adds
J%,
an
overflow
will
occur.
The
compiler follows
the
rules
for
operator
precedence
and
parenthetic
modification
of
such precedence, but no other
guarantee of evaluation order can be made.
In order to produce the fastest and most compact object code
possible,
make
maximum
use
of
integer
variables.
For
example, this program
FOR I=1 TO
10
A(I)~O
NEXT I
can
execute
approximately
30
times
faster
by
simply
substituting RI%" for "I".
It is especially advantageous to
use integer variables
to
compute
array
subscripts.
The
generated code is significantly faster and more compact.