The following table illustrates the operator precedence for each operator, that is, the order in which operators are evaluated. Operators with a higher precedence are evaluated first, while operators having the same level of precedence are evaluated in the order that they appear (i.e. left to right).
For example, 1 + 2 * 3 is equal to 7, not 9, as the operator precedence for * (multiplication) is higher than + (addition). In this case, newlook multiples 2 by 3, giving 6, then adds this to the 1, giving 7.
Operators within the same section are of equal precedence.
Order |
Symbol |
Operator |
Highest |
() |
Parentheses |
+ - |
Urary plus (positive Urary minus (negative) |
|
^ |
Arithmetic exponentiation |
|
* / |
Arithmetic multiplication Arithmetic division |
|
\ or Div |
Arithmetic integer division |
|
Mod |
Arithmetic modulus |
|
+ - |
Arithmetic addition Arithmetic subtraction |
|
& |
String concatenation |
|
= <> < > <= >= Like |
Logical equals Logical not equals Logical less than Logical greater than Logical less then or equal to Logical greater than or equal to String pattern match |
|
Not |
Logical not |
|
And |
Logical and |
|
Or |
Logical or |
|
Xor |
Logical exclusive-or |
|
Equ |
Logical equivalence |
|
Lowest |
Imp |
Logical implication |
© 2004-2021 looksoftware. All rights reserved.