Bad Wigins wrote:
feef wrote:
Transformations for the above trivial cases exist so that only associative operations are necessary, e.g., a%b => a*(1/b), or more generally a*b^(-1)
While I miswrote it as "commutative," it's no mere transformation, it's the very definition of division! It's how it is read.
9/2a? that's 9/2 x a,, i.e. 9a/2, unless you put 2a in parentheses. Absolutely no ambiguity about it at all.
The ambiguity can only be removed when everyone agrees on the same convention. These threads and others before it, should serve as proof that there is no such universally agreed convention, as each “side” bets their degrees on being right.
The issue is not division or commutative or transformative or the choice of division symbol, or whether PEMDAS is misinterpreted as multiplication comes first, but whether the convention says that “implied multiplication” (by juxtaposition with no explicit operator) takes precedence over explicit multiplication and division, such that the juxtaposed terms should be treated as one term.
For those who argue “unambiguously 1”, your definition of division adds no value to the discussion as it simply becomes:
6 / (2*(1+2))^(-1)
To all these “experts” who work everyday with math, I imagine that you must have the tools and the capability to write these equations using equation editors and mathematical typesets, or writing with pencil and paper, or on a whiteboard (or a blackboard) over multiple lines, or at the very least, your keyboard includes parentheses, square brackets and curly brackets.
For programmers forced to code “inline”, the right expression is one that correctly models the problem, in any form, and cannot be determined by a debate in a forum among those who are failing to listen.