MDAS and operator precedence

In evaluating the second of these equations:

b = g/(2h)
c = g/4
h

do you divide by four, then multiply that result by h?

Web sources are about equally split between saying the MDAS precedence order means “do all operators that are either multiplication or division in a left to right order, then all that are either addition or subtraction in a left to right order” and saying it means do all multiplications, then all divisions, etc.

The fellow down the hall says that Excel now has trained everybody to do “all divisions, then all multiplications…”. Weird - dunno if true. But the reference I’m reading is from 1983 and probably predates spreadsheet influences.

Note that the first equation provides a hint that if h in the second equation were to wind up in the denominator it would have been made explicit with parentheses.

What say the Dopers?

More gleanings:
In C++ and in Excel and in SAS (a statistics package), it looks like M and D are of equal rank and they are both evaluated in relative order determined only by their left-to-right order.

I still think a/b*c is dangerous notation, though, especially considering how many people seem to think all the multiplications are to be done before any of the divisions.

I thought it was standard that a/b*c = (a/b)*c, and Maple (one of the big computer algebra systems) evaluates it that way.

Agreed. This is the first time I’ve ever heard of the possibility of multiplication and division having different precedence.

The way I see it, division is really just multiplication of the reciprocal, and should be treated as another multiplication. Similarly, subtraction is just addition of the negative.

Multiplication and division have equal precedence and are grouped left to right.

It is somewhat precarious to use any software implementation as a definition of arithmetic rules because they might not have implemented it rigorously. The result of division by zero is *not * “#DIV/0!”.

(I used to teach Ada, and Ada had the “quirk” of implementing the mod function exactly as is mathematically correct, rather than the way that C and many other languages implemented it. I would have to look it up to remember the specific difference, I think it had to do with the way negative numbers were treated, but there was no end to the discussion.)

Just remembered–at my school, we learnt the rules of operator precedence as BEDMAS* (Brackets, Exponentiation, Division, Multiplication, Addition, Subtraction). The only way BEDMAS and MDAS could both be correct is if division and multiplication have the same precedence.

*PEDMAS would be more correct but doesn’t have the word ‘bed’ in it.

Thanks, all - I’m happy concluding M and D typically have same rank, although unfortunately if people are not agreed about this it is hard to know what somebody means. My own worry is in interpreting other people’s statements.

It is interesting to google “my dear aunt sally” and see how many people state that M outranks D, which would change the value of a/b*c. The problem is, I think, that “MDAS” doesn’t express “(M<>D)(A<>S)”.

Yes, multiplication and division are inverses of each other. I see a deduction that extends that to the conclusion that notationally they enjoy equal rank, but that doesn’t necessarily imply that the notation would work that way. The underlying assumption is that a notational mechanism that occurs to us as sensible must be the one at work - which could be wrong because notational things themselves can be weird (why can the multiplication operator be left blank? why isn’t there a separate negation character? why can “=” imply an assertion or a test or an assignment?) or could be wrong because the sensibility that occurs to us is faulty or not the relevant one.

When I was in the 8th grade (~1971), my algebra teacher one day said with a great air of gravity, “Do you know my dear Aunt Sally? My dear Aunt Sally is dead.” We gasped. “And she’s buried in a gray box…” We gasped again. “…on page 84.” Page 84 of our algebra book was a gray box with a sidebar on operator precedence, which said that multiplication and division have equal precedence, as do addition and subtraction.