Navigation: Realtest Script Language > Formula Syntax >

Operators

 

 

 

The following table lists all of the operators can be used in any RealTest script formula.

The general structure of a formula is term operator term.

The definition of term in this structure is ... any formula.

The examples in the table below show the simplest possible structure, with just a number on either side of each operator.

 

Operator

Alternative

Precedence Rank

Description

Example

^

 

1

power, as in x^y (x to the power y)

9 ^ 2 is 81

*

 

2

multiplication

 9 * 2 is 18

/

 

2

division

6 / 2 is 3

MOD

%

2

modulo (remainder after division)

10 MOD 3 is 1

+

 

3

addition

2 + 2 is 4

-

 

3

subtraction

9 - 2 is 7

>

 

4

greater than

7 > 5 is true

>=

 

4

greater than or equal to

7 >= 7 is true

<

 

4

less than

7 < 5 is false

<=

 

4

less than or equal to

7 <= 7 is true

=

==

5

is equal to

7 = 7 is true

<>

!=

5

not equal to

7 <> 7 is false

AND

&&

6

logical and

true AND false is false

OR

||

7

logical or

true OR false is true

 

The Precedence Rank column comes into play when formulas include more than one operator. Lower numbers mean higher precedence.

Operators with higher precedence rank are evaluated first, no matter where they are in the formula.

Operators with the same precedence rankare evaluated from left to right.

The best practice, to avoid confusion, is to use parentheses to make precedence explicit in your formulas.

A couple of examples to clarify this:

"value1 + value2 * value3" would be the same as "value1 + (value2 * value3)", because * has higher rank than +.

"condition1 OR condition2 AND condition3" would be the same as "condition1 OR (condition2 AND condition3)" because AND has higher rank than OR.

Note that RealTest script syntax does not include a "NOT" operator. Instead, logical NOT is implemented as a function.

 

 

 

Copyright © 2020-2021 Systematic Solutions, LLC