Recent Articles



































Order of operations



         


In arithmetic and elementary algebra, certain rules are used for the order in which the operations in algebraic expressions are to be evaluated. These precedence rules (which are mere notational conventions, not mathematical facts) are also used in many programming languages and by most modern calculators. In computing the standard algebraic notation is known as infix notation. This article assumes the reader is familiar with addition, division, exponential powers, multiplication, and subtraction.

[Top]

The standard order of operations

1. Evaluate subexpressions contained within parentheses, starting with the innermost expressions. (Brackets [ ] are used here to indicate what is evaluated next.)
<math>(4+[10/2])/9=[4+5]/9=1 \,<math>
2. Evaluate exponential powers; for iterated powers, start from the right:
<math>2^{[3^2]}=[2^9]=512 \,<math>
3. Evaluate multiplications and divisions, starting from the left:
<math>[8/2]\times3=[4\times3]=12 \,<math>
4. Evaluate additions and subtractions, starting from the left:
<math>[7-2]-4+1=[5-4]+1=[1+1]=2 \,<math>

The expression: 2 + 3 × 4 is evaluated to 14, and not 20, because multiplication precedes addition. If the intention is to perform the addition first, parentheses must be used: (2 + 3) × 4 = 20.

In the UK, the acronym BODMAS is used for Brackets, raise to the power Of, Division, Multiplication, Addition, Subtraction. The "O" may also stand for "or", or may by replaced with an "I", for Indices.

In the US, the acronym PEMDAS (for Parentheses, Exponentation, Multiplication/Division, Addition/Subtraction) is used instead, sometimes expressed as the mnemonic "Please Excuse My Dear Aunt Sally".

[Top]

Example

<math>3-(5-(7+1))^2\times(-5)+2<math>
<math>3-(5-8)^2\times(-5)+2<math>
<math>3-(-3)^2\times(-5)+2<math>
<math>3-9\times(-5)+2<math>
<math>3-(-45)+2<math>
<math>48+2<math>
<math>48+2=50<math>
[Top]

See also





  View Live Article   This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License