this post was submitted on 03 Dec 2023
420 points (99.8% liked)
196
16597 readers
1783 users here now
Be sure to follow the rule before you head out.
Rule: You must post before you leave.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
There's quite a few calculators that get this wrong. In college, I found out that Casio calculators do things the right way, are affordable, and readily available. I stuck with it through the rest of my classes.
My Casio calculators get this wrong, even the newer ones. BTW the correct answer is 16, right?
(8 ÷ 2) × (2 + 2)
8 ÷ (2 × (2 + 2))
2 2 + 8 2 ÷ × .
(× (÷ 8 2) (+ 2 2))
prefix notation doesn't need parentheses either though, at least in this case. lisp uses them for readability and to get multiple arity operators. infix doesn't have any ambiguity either if you parenthesize all operations like that.
There isn't any ambiguity even if you don't.