Using arithmetic expressions

You can include arithmetic expressions as the left operand of a conditional expression.

During standardization, rule sets only test the output of arithmetic expressions. The rule sets do not generate the answer to arithmetic expressions to populate the output.

The available arithmetic operators are:

Arithmetic Operator Value
+ Addition
Subtraction
* Multiplication
/ Division
% Modulus

Arithmetic is limited to one operation per expression. Parentheses are not permitted. The modulus operation is the remainder of an integer division. For example, x % 2 is zero if the number is divisible by two. It is one if the number is odd.

An arithmetic expression is


left-arithmetic-operand arithmetic-operator right-arithmetic-operand
Operation Valid Value
left-arithmetic-operand
  • variable-name
  • {field-name}
  • {}
arithmetic-operator

+
–
*
/
%
right-arithmetic-operand
  • variable-name
  • constant

Examples of arithmetic expressions are:

Expression Description
temp –2 The value of temp –2
{} % 2 The current operand value of modulo 2

The following conditional expression can be used for matching to even-numbered houses.


^ [{} % 2 = 0]

Even numbers are divisible by two, thus the house number modulo two is zero. The arithmetic expression appears on the left side of the relational operator (the equal sign).

The following syntax is a conditional expression to see if the current operand divided by three is greater than the contents of variable temp:


^ [{} / 3 > temp]

Again, note that the field references and the arithmetic expression are to the left of the relational operator. Other examples are:


[ temp * temp2 > temp3 ]
[ {ZipCode} + 4 > 12345]