Let's look at 5 * 4 - 2
Do you multiply 5 by 4 and then subtract 2 to get an answer of 18
or
Do you subtract 2 from 4 and the multiply by 5 to get an answer of 10
To avoid this confusion, a order of operations is defined and accepted by the world. In this simple case, multiplication takes precedence over subtraction, so the correct answer is 18.
Mathematical operations include exponentiation, multiplication, division, addition and subtraction. If you are into computer programming, you can add logical operations to this set of operations. There is a set orders of computation that has been agreed upon by everyone to give consistent answers no matter who evaluates the expression. One caveat to this is the use of parentheses to force the order of evaluation in certain desired ways.
Chat with our AI personalities