2023-10-16 06:28 UTC
3/11
...and note that it's the number that follows it. i.e. in the expression 6-5+2, the minus sign is associated with the 5, NOT the 6, hence left associativity - a term is associated with whatever sign is on it's left (and of course the 6 is associated with a +, but we don't normally write + at the start of an expression, only if it's a -, and even that we try to avoid. i.e. if we had an expression -a+b, we would usually write it as b-a)...
Replies (1)
-
@SmartmanApps@dotnet.social 2023-10-16 06:29
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...