When multiple operators appear within an expression, these are processed as follows:
If you are uncertain how an expression will be evaluated, you are advised to use parentheses. This is particularly important when the expression exists in logic that is not typically executed -- e.g. in THEN/ELSE clauses, or WHEN/OTHERWISE clauses.
Some examples are helpful.
|2 + 3 * 4||14||* is performed first, then +|
|(2 + 3) * 4||20||the parenthesized expression is evaluated first|
|2**2**3||64||not 256 -- the ** have equal precedence, hence they are processed left to right|
The order of operator precedence is as follows, from highest to lowest.
|8||Prefix operators||+ - ¬ \|
|6||Multiplication and division operators||*/ % //|
|5||Addition and subtraction operators||+ -|
|4||Concatenation operators||(blank) (abuttal)|
|3||Comparative operators||= == ¬= \= <> > < >= <= ¬> << \>> etc.|
|2||Logical and operator||&|
|1||Logical or and exclusive or operators||| &&|
Note: the ¬ operator is a logical-not operator that is not available in all implementations. The backslash (\) is now preferred.