Developer Documentation Library > Scripting > Expressions > Operators > Operator precedence
 
Operator precedence
When there is more than one operator in an expression, the operators are evaluated in a specified order, known as the order of precedence, which is shown in the following table. When operators are at the same level of precedence, they are evaluated from left to right.
You can override the order of precedence by using parentheses. Operators that are contained within parentheses are evaluated before operators that are not contained within parentheses. However, when more than one operator is contained within parentheses, they are evaluated according to the normal order of precedence.
This table lists the operators in reverse order of precedence. Operators marked 5 are evaluated first, those marked 4 are evaluated next, and so on.
Precedence
Operator
Associativity
1
And
Left
1
Or
Left
1
Xor
Left
2
=
Left
2
<>
Left
2
<
Left
2
>
Left
2
>=
Left
2
<=
Left
2
=*
Left
3
+
Left
3
-
Left
3
Like
Left
4
*
Left
4
/
Left
4
Mod
Left
5
Not
Right
6
+
If the long add long overflow, the result is a double. For example. 2147483647 + 1 = 2147483648.
6
-
If the long sub long overflow, the result is a double. For example -2147483647 - 1 = -2147483648.
6
*
If the long multiply long overflow, the result is a double. For example 76663 * 654263 = 50157764369.
See
Operators