Numeric Operators

Developers can combine numeric values and arithmetic operators to perform calculations. The following is a list of PRO/5 numeric operators in order of precedence. Execute operators with the same precedence from left to right.

Operators Description

-

Unary Minus (Negation)

LET A=-B

^

Exponentiation (raise a number to an integer or non-integer power)

LET A=B^C

*

/

Multiplication and division

LET A=B*C, X=Y/Z

+

-

Addition and subtraction

LET A=B+C, X=Y-Z

<

>

=

<=

>=

<>

Relational Operators 

LET A=B<C, X=Y<>Z

AND

OR

Logical Operators

LET A=B OR C, X= Y AND Z

Use parenthesis to change the order of execution of operators. PRO/5 supports at least 10 levels of parenthetic nesting (multi-line functions may reduce this), including array subscripts and function calls.

Relational Operators: <, >, =, <=, >=, <>

Developers can use relational operators to compare two numeric values or two strings. If the relation is true, the result is 1; otherwise, the result is 0. When comparing two numbers, their values round to the current precision during the compare. See the PRECISION verb for more information.

Example

 LET A= B<C, X=Y<>Z

Logical Operators: AND, OR

The result of AND is 1 if both of its operands are nonzero, otherwise, the result is 0.

The result of OR is 1 if either or both of its operands are nonzero, otherwise the result is 0.

PRO/5 features short-circuit evaluation of the AND and OR operators.

Example

 LET A= B AND C, X=Y OR Z

See Also

!() Function - Logical Not