Order of Precedence

The standard mathematical order of operations is followed when an expression is evaluated.

Expressions can contain constants, variables, unary or binary operators, and mathematical or string manipulating functions. Parentheses can be nested to any depth in an expression.

The following table outlines the operators in order of precedence (highest to lowest), with those of equal precedence grouped together:
Symbol Operation Associativity
() Function argument, parenthesis left to right
! Logical NOT right to left
+ Plus (unary +)
- Minus
^ Raise to power right to left
* Multiply left to right
/ Divide
% Modulus
+ Add left to right
- Subtract
< Less than left to right
> Greater than
<= Less than or equal to
>= Greater than or equal to
== Equal to left to right
!= Not equal to
&& Logical AND left to right
|| Logical OR left to right