Operator precedence and evaluation ordering

The order of precedence controls the order in which operators in an expression are evaluated. The order of precedence is as follows. (Some alternative names for operators, such as EQUALS and GREATER THAN OR EQUAL TO are omitted for brevity.)

Unary +, Unary - 
^ 
*, / 
\ 
MOD 
+, - 
& 
EQ, NEQ, LT, LTE, GT, GTE, CONTAINS, DOES NOT CONTAIN, ==, !=, >, >=, <, <= 
NOT, ! 
AND, && 
OR, || 
XOR 
EQV 
IMP

To enforce a nonstandard order of evaluation, parenthesize expressions. For example:

  • 6 - 3 * 2 is equal to 0

  • (6 - 3) * 2 is equal to 6

You can nest parenthesized expressions. When in doubt about the order in which operators in an expression are evaluated, use parentheses to force the order of evaluation.