Precedence is the rule that determines the order in which operators are applied in an expression. For example,
has value
by operator precedence (or "order of operations"). Precedence of common
operators is generally defined so that "higher-level" operations are performed
first (i.e., advanced operations "bind more tightly"). For simple expressions,
operations are typically ordered from highest to lowest in the order:
1. Parenthesization,
2. Factorial,
3. Exponentiation,
4. Multiplication and division,
5. Addition and subtraction.
For more complex operations, the order of operations depends on the system.
A number of geographically-varying methods for remembering basic precedence rules exist, e.g., PEMDAS in the United States.