Hacker News new | ask | show | jobs
by tejtm 1753 days ago
It is ambiguous,

"Two plus Three times Five" as a sentence reads and is naturally processed from left to right for a result of " is twenty-five".

But to anyone who knows math (precedence), "2 + 3 * 5 = 17"

2 comments

Yeah. That's a trivial case but I'd still probably use parentheses). For more complex precedence operations I definitely would.
The order of operations doesn't change because the equation is written out in English versus mathematical notation.
"There is no ambiguity because my context is the only context"

I learned a few years back that lawyers will give you a bunch of "ands" and "ors" in an expression without any concept of precedence. That doesn't necessarily mean left to right works, either.

How do you say and/or spell out parentheses?
Easy: Take two plus five and multiply it by six