2023-10-16 06:29 UTC
4/11
Now, some of my Tech followers would be aware that sometimes in programming we use postfix notation, which is right associativity - e.g 2+3 is stored as 23+ - but in Maths we only use left associativity.
Next, * and / are binary operators. i.e. they are associated with TWO terms - both the one that follows and the one that precedes it (whereas unary operators are only associated with the term that follows them).
So let's see what that all means for order of operations...
Replies (1)
-
@SmartmanApps@dotnet.social 2023-10-16 06:31
5/11 Consider 2+3*4. Some claim that the order of operations were "arbitrarily" made up in order to make this not "ambiguous". This isn't the case at all! The order of operations are the natural result of all that we have defined so far. They say "how do you know whether to do the addition first or the multiplication first without these arbitrary rules?". Easy... We have 3 "terms" (if we accept "ambiguity") - 2 (which is associated with an unwritten +), +3, and 3x4. What to do with the 3?...