The rules determining the order in which operations are carried out, if this is not defined unambiguously by brackets. For example, in most languages the expression
will be evaluated by doing the multiplication first, and brackets would be used to enforce the alternative order thus:
There is no consensus about precedence of operations in language, particularly when new operators may be introduced. A simple order used in Pascal is as follows:
unary NOT
multiplying operators
adding operators
relational operators
Other languages may have further operators such as exponentiation and further categories such as logic operators, whose position in the order would be defined. Operators of the same precedence are usually applied in order from left to right, but in some languages the order is undefined.