you’re just using (AS) without realizing it
as per the textbooks 🙄
Conversations around operator precedence can cause real differences in how expressions are evaluated
No they can’t. The rules are universal
you might not underatand it yourself
says someone about to prove that they don’t understand it… 😂
With (AS), 3-2+1 = (3-2)+1 = 1+1 = 2
Nope! With AS 3-2+1=+(3+1)-(2)=4-2=2
This is what you would expect
Yes, I expected you to not understand what AS meant 😂
since we do generally agree to evaluate addition and subtraction with the same precedence left-to-right
It’s only a convention, not a rule, as just proven
With SA, the evaluation is the same
No it isn’t. With SA 3-2+1=-(2)+(3+1)=-2+4=2
you get the same answer
Yep, because order doesn’t matter 🙄 AS and SA both give the same answer
No issue there for this expression
Or any expression
But with AS, 3-2+1 = 3-(2+1)
You just violated the rules and changed the sign of the 1 from a + to a minus. 🙄 -(2+1)=-2-1, not -2+1. Welcome to how you got a wrong answer when you wrongly added brackets to it and mixed the different signs together
So evaluating addition with higher precedence rather than equal precedence yields a different answer
No it doesn’t., as already proven. 3-2+1=+(3+1)-(2)=+4-2=2, same answer 🙄
SmartmanApps@programming.dev 3 days ago
It’s hilarious that you added in this in afterwards, hoping I wouldn’t see it so you could claim the last word 😂
There is only one order of operations, defined in many Maths textbooks.
Hence the order of operations rules, found in Maths textbooks
PEMDAS actually, and yes, it’s only a convention, not the rules themselves
That’s why it’s only a convention, and not a rule.
Nope, doesn’t cause any issues - the rules themselves are the same everywhere, and all of the different mnemonics all work
No it doesn’t
Just -b actually
Which is still subtraction, from 0, because every operation on the numberline starts from 0, we just don’t bother writing the zero (just like we don’t bother writing the + sign when the expression starts with an addition).
Subtraction is unary operator, not binary. If you’re subtracting from another number, then that number has it’s own operator that it’s associated with (and might be an unwritten +), it’s not associated with the subtraction at all.
No you can’t. You can put it in Brackets to make it joined to the minus sign though, like in (-1)²=1, as opposed to -1²=-1
The 1 can’t be positive if it follows a minus sign - it’s the rule of Left Associativity 😂
Image
No, they’re just you spouting more wrong stuff 😂
No, you can’t. Giving addition a higher priority is +(3+2)-1=+5-1=4, as per Maths textbooks…
Image
No, all of it was wrong, again 😂