The following table summarizes the operators, listing them in order of precedence from highest to lowest:
Category |
Operators |
Primary |
Primary operators include: number, string, true/false, constant, array brackets [ ], sub-expression, function (see the Functions section later in this chapter), and link (see the Links section later in this chapter). |
Evaluate |
{} |
Parentheses |
( ) |
Unary |
+ -NOT BNOT |
Power |
^ |
Multiplicative |
* / % or MOD |
Additive |
+ - |
Shift |
<< >> |
Relational and equality |
< > <= >= = != or <> |
Binary AND |
BAND |
Binary XOR |
BXOR |
Binary OR |
BOR or | |
Conditional AND |
AND |
Conditional XOR |
XOR |
Conditional OR |
OR |
When an expression contains multiple operators, the precedence of the operators controls the order in which the individual operators are evaluated. When an operand occurs between 2 operators with the same precedence, operations are performed from left to right. Precedence can be controlled using parentheses.
Arithmetic functions can be found in the Functions section later in this chapter.