Example of constructing an arithmetic expression:
An arithmetic expression may be proceeded by a + or - sign. These operations are known as unary + or unary - operators.
Illustrations of the valid arithmetic expressions are:
Note that whenever the right-hand side of a COMPUTE verb is a single identifier or literal, then the effect is that of a MOVE statement.
COMPUTE A = B + C
has similar effect as that of the ADD B C GIVING A
COMPUTE F = 1.8 * C + 32
The value of the expression on the right-hand side is computed and this value is then moved to the F. Assume that the C & F are defined with pictures 99 & ZZ9.9 respectively and the present value of C is 3. Subsequently after the execution of the statement, the F will have the value 37.4.