Comment on I dunno

<- View Parent
Feathercrown@lemmy.world ⁨3⁩ ⁨days⁩ ago

Uh, no. I don’t think you’ve thought this through, or you’re just using (AS) without realizing it. Conversations around operator precedence can cause real differences in how expressions are evaluated and if you think everyone else is just being pedantic or is confused then you might not underatand it yourself.

Take for example the expression 3-2+1.

With (AS), 3-2+1 = (3-2)+1 = 1+1 = 2. This is what you would expect, since we do generally agree to evaluate addition and subtraction with the same precedence left-to-right.

With SA, the evaluation is the same, and you get the same answer. No issue there for this expression.

But with AS, 3-2+1 = 3-(2+1) = 3-3 = 0. So evaluating A with higher precedence rather than equal precedence yields a different answer.

source
Sort:hotnewtop