An arithmetic operator performs a numerical calculation such as addition, subtraction, multiplication, or division. Its role becomes precise when expressions are evaluated according to the order of operations. section 12.1
Evaluate arithmetic expressions by applying these rules:
- Evaluate parenthesized subexpressions first. section 12.1
- Then evaluate exponentiation, multiplication and division, and addition and subtraction in that order. section 12.1
- Replace each completed subexpression with its numerical result and continue recursively. section 12.1
Operator precedence in practice
The expression 1 + 2 * 3 evaluates multiplication before addition, producing 7. In 1 + 2 * (3 + 4), the parenthesized expression is evaluated first, producing 15 overall. section 12.1
Figure 12.1 Evaluation of 1 + 2 * 3 according to the PEMDAS rule
Trace how 1 + 2 * 3 is evaluated according to PEMDAS. section 12.1

