On Wed, Dec 16, 2020 at 3:16 AM David Mertz
On Tue, Dec 15, 2020 at 11:22 AM Chris Angelico
wrote: I'm pretty sure most of us learned *in grade school* about BOMDAS or BODMAS or PEMDAS or whatever mnemonic you pick.
I don't think I ever learned such acronyms! I mean, yes I learned about order of operations in grade school. But never with a mnemonic.
I learned BOMDAS - Brackets, O (varies in expansion but always minor things you don't often see), Multiplication, Division, Addition, Subtraction. For some reason it's also written BODMAS, which has the exact same meaning (since multiplication and division have the same precedence) but is harder to pronounce. PEMDAS uses "parentheses" instead of "brackets" (so it's probably an American English vs British English thing), and "exponentiation" in place of the first vowel. Whichever way you learned it, though, you probably learned a few quirks of algebraic notation that don't really apply to programming (such as the fraction bar), but for the most part, you'd have learned the exact model that most expression evaluators use. ("Most" because, as always, there are exceptions, but it's a good default to start with.) ChrisA