An arithmetic expression is a series of arithmetic operands and operators that can be reduced to a single numeric value. An operand can be any numeric expression. Arithmetic operators include plus (+), minus (‑), times (*), divided by (/), and exponentiation (**exponent).
The exponent is a single numeric field or literal with a positive integer value or an alphanumeric field that consists only of numerals; an exponent cannot be an arithmetic expression; the maximum value for an exponent is 999.
An arithmetic expression that contains one or more null values results in a null value.
Parentheses specify the order of evaluation of an arithmetic expression. But if you omit parentheses, exponentiation is performed first, multiplication and division are performed next, and addition and subtraction are performed last. When two or more operators appear without parentheses and are at the same level, evaluation is from left to right. For example, if numerals are assigned to the following field,
A = 7 C = 8 B = 3 D = 2
Then the following expression is equivalent to,
A + B ‑ C/D equals 6
whereas the following expression with parentheses is equivalent to,
(A + B ‑ C)/D equals 1
In an arithmetic expression, a "‑" or "+" must be surrounded by blanks or parentheses as follows:
A + B*C ‑ D
(A*B)‑(C*D)
You cannot use non‑alpha groups, condition names, flags, and alphanumeric literals in arithmetic expressions.
The following are examples of valid arithmetic expressions:
A + B A*B (A*B)/C (A + B**C)/D**E
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|