Order+of+Operations

__Order of Operations__

The order in which an equation is performed. The order is (from top to bottom): code format="java" //Parenthesis //Exponents //Multiplication //Division //Modulus (only applies in programming) //Addition //Subtraction code

A common mneumonic device to remember this is PEMDAS (PEMDMAS in programming) An example in code:

code format="java" public int orderOps(double x) { x = (2 * 3 - 1) + 2/4 return x;

//Step 1: Parenthesis come first, so we look at whats in there //Step 2: Multiplication comes before subtraction, so we multiply 2*3, which equals 6 //Step 3: Subtract 1 from 6 to get 5 //Step 4: Division comes before addition, so divide 2 by 4 to get 0.5 //Final Step: Add 5 and 0.5 //Solution: x = 5.5 }

code