Precedence

If several operators exist in a single expression and parentheses have not been used then the expression is evaluated in a strict order. This order is known as "operator precedence"
When operators have the same precedence they are evaluated from left-to-right.
Parentheses can be used to overwrite the order and to evaluate certain parts of the expression. Operations inside parentheses are always performed before those outside.


When a series of operators appear in the same expression there is a strict order in which they will be evaluated.
The rules of precedence tell the compiler which operators to evaluate first.
Parentheses can obviously be used to change the order of precedence.
Operators are evaluated in the following order: Mathematical, Concatenation, Relational, Logical.


OrderOperatorSymbol
1Exponentiation^
2Negation-
3Multiplication*
3Division/
4Division with Integer result\
5ModuloMod
6Addition+
6Subtraction-
7String Concatenation&
8Equal or Assignment=
8Not Equal To<>
8Less Than<
8Greater Than>
8Less Than or Equal To<=
8Greater Than or Equal To>=
9NotNOT
10AndAND
11OrOR
12Exclusive ORXOR
13EquivalenceEQV
14ImplicationIMP


© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext