http://en.wikipedia.org/wiki/Order_of_operations
The order of operations used throughout mathematics, science, technology and
many computer programming languages is expressed here:[2]
exponents and roots
multiplication and division
addition and subtraction
This means that if a mathematical expression is preceded by one binary operator and followed
by another, the operator higher on the list should be applied first.
10 - 3 + 2
The correct answer is 9 (and not 5, which we get when we do the addition first and then the subtraction).
The best way to understand a combination of addition and subtraction is to think of the subtraction
as addition of a negative number.
In this case, we see the problem as the sum of positive ten,
negative three, and positive two.
10 + (-3) + 2