Order of operations

Order of operations

In mathematics and computer programming, the order of operations is a collection of rules that reflect conventions about which operations to perform first in order to evaluate a given mathematical expression.

These rules are formalized with a ranking of the operations. The rank of an operation is called its precedence, and an operation with a higher precedence is performed before operations with lower precedence. Calculators generally perform operations with the same precedence from left to right,[1] but some programming languages and calculators adopt different conventions.

For example, multiplication is granted a higher precedence than addition, and it has been this way since the introduction of modern algebraic notation.[2][3] Thus, in the expression 1 + 2 × 3, the multiplication is performed before addition, and the expression has the value 1 + (2 × 3) = 7, and not (1 + 2) × 3 = 9. When exponents were introduced in the 16th and 17th centuries, they were given precedence over both addition and multiplication and placed as a superscript to the right of their base.[2] Thus 3 + 52 = 28 and 3 × 52 = 75.

These conventions exist to avoid notational ambiguity while allowing notation to remain brief.[4] Where it is desired to override the precedence conventions, or even simply to emphasize them, parentheses ( ) can be used. For example, (2 + 3) × 4 = 20 forces addition to precede multiplication, while (3 + 5)2 = 64 forces addition to precede exponentiation. If multiple pairs of parentheses are required in a mathematical expression (such as in the case of nested parentheses), the parentheses may be replaced by other types of brackets to avoid confusion, as in [2 × (3 + 4)] − 5 = 9.

These rules are meaningful only when the usual notation (called infix notation) is used. When functional or Polish notation are used for all operations, the order of operations results from the notation itself.

  1. ^ Cite error: The named reference Microsoft was invoked but never defined (see the help page).
  2. ^ a b Cite error: The named reference BS was invoked but never defined (see the help page).
  3. ^ Cite error: The named reference Peterson was invoked but never defined (see the help page).
  4. ^ Cite error: The named reference Swokowski was invoked but never defined (see the help page).

From Wikipedia, the free encyclopedia · View on Wikipedia

Developed by Nelliwinne