Enform Plus Reference Manual
Enform Plus Language Elements
Enform Plus Reference Manual—422684-001
3-22
Evaluation Order of Arithmetic Expressions
Evaluation Order of Arithmetic Expressions
Arithmetic expressions are evaluated in the following order:
1. Nested parenthesized expressions are evaluated first, beginning with the innermost
expression.
2. Within a nested parenthesized expression, multiplication and division operations are
evaluated next.
3. Within a nested parenthesized expression, addition and subtraction operations are
evaluated last.
Scale Factor of the Result
The scale of the result is determined by the number of digits after the decimal point. In
an arithmetic expression, the result has the same number of digits after the decimal point
as the field or variable in the expression with the greatest precision. This condition could
result in loss of significant digits if too great a precision is used for the field or variable.
The resulting scale factor can be controlled by assigning the result of the arithmetic
expression to a user variable. (User variables are explained on page 3-27
.) The precision
of the user variable can be specified by an INTERNAL clause within the DECLARE
statement that defines the user variable. The maximum number of digits allowed is 18.
All calculations with Enform Plus are performed with QUAD arithmetic.
Logical Expressions
Logical expressions evaluate to a truth value-either true or false based on a condition
specified within the expression. Both the conditions that can be specified and the
conditional operators are listed in Table 3-4
.
Enform Plus provides two other conditional operators: BEGINS WITH and CONTAINS.
The three symbols ']' are synonymous with BEGINS WITH and the three symbols
'>' are synonymous with CONTAINS.
Table 3-4. Conditional Operators
Condition Keyword Abbreviation Symbol
Equal EQUAL
IS
EQ =
Not equal NE <>
Greater than GREATER [THAN] GT >
Greater than or equal to GE >=
Less than LESS [THAN] LT <
Less than or equal to LE <+