2023-10-16 06:31 UTC
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?...
Replies (1)
-
@SmartmanApps@dotnet.social 2023-10-16 06:32
6/11 In 2+3*4, 3 is both associated with a + AND with *4. You know what it's NOT associated with - because + is a unary operator - the 2. So it IS associated with the 4, but not the 2, so we have to do the multiplication first! This is a natural consequence of * being a binary operator! It associates 2 numbers with each other, unlike a unary operator which is only associated with 1 number. But let's put that aside for a moment and look at "addition first" from another angle...