>>10972845>>10972853RE: This thread though, if you want to insist on working with infix, then the answers are:
A) If you're a physicist you probably assign operator precedence to multiplication by juxtaposition, meaning you would multiply 2 by (2+2) before dividing 8 by that, resulting in the answer of 1.
B) If you're a non-physicist who was taught PEDMAS then you would assign equal ordering rank to multiplication and division, meaning you would divide 8 by 2 before multiplying (2+2) by that, resulting in the answer of 16.
The only sincerely stupid answer here is to respond by picking one or the other and behaving like the particular arbitrary approach out of those two you happen to not be in the habit of using is somehow "wrong" while yours is somehow "right."
In RPN the problem goes away because you either have:
A) 2 2 + 2 * 8 /
B) 8 2 / 2 2 + *
No arbitrary ordering rules, no parentheses, only one unambiguous answer for whatever you write. This is what every program ever translates your crappy infix to when mathematical calculations are performed.