this post was submitted on 27 Nov 2025
11 points (100.0% liked)

Science Memes

17750 readers
2006 users here now

Welcome to c/science_memes @ Mander.xyz!

A place for majestic STEMLORD peacocking, as well as memes about the realities of working in a lab.



Rules

  1. Don't throw mud. Behave like an intellectual and remember the human.
  2. Keep it rooted (on topic).
  3. No spam.
  4. Infographics welcome, get schooled.

This is a science community. We use the Dawkins definition of meme.



Research Committee

Other Mander Communities

Science and Research

Biology and Life Sciences

Physical Sciences

Humanities and Social Sciences

Practical and Applied Sciences

Memes

Miscellaneous

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Feathercrown@lemmy.world 1 points 3 days ago (9 children)

They do, it's grouping those operations to say that they have the same precedence. Without them it implies you always do addition before subtraction, for example.

[–] SmartmanApps@programming.dev -1 points 3 days ago* (last edited 3 days ago) (8 children)

They do, it’s grouping those operations to say that they have the same precedence

They don't. It's irrelevant that they have the same priority. MD and DM are both correct, and AS and SA are both correct. 2+3-1=4 is correct, -1+3+2=4 is correct.

Without them it implies you always do addition before subtraction, for example

And there's absolutely nothing wrong with doing that, for example. You still always get the correct answer 🙄

[–] Feathercrown@lemmy.world 3 points 2 days ago* (last edited 2 days ago) (7 children)

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 addition with higher precedence rather than equal precedence yields a different answer.

=====

Some other pedantic notes you may find interesting:

There is no "correct answer" to an expression without defining the order of operations on that expression. Addition, subtraction, etc. are mathematical necessities that must work the way they do. But PE(MD)(AS) is something we made up; there is no actual reason why that must be the operator precedence rule we use, and this is what causes issues with communicating about these things. People don't realize that writing mathematical expressions out using operator symbols and applying PE(MD)(AS) to evaluate that expression is a choice, an arbitrary decision we made, rather than something fundamental like most everything else they were taught in math class. See also Reverse Polish Notation.

Your second example, -1+3+2=4, actually opens up an interesting can of worms. Is negation a different operation than subtraction? You can define it that way. Some people do this, with a smaller, slightly higher subtraction sign before a number indicating negation. Formal definitions sometimes do this too, because operators typically have a set number of arguments, so subtraction is a-b and negation is -c. This avoids issues with expressions starting with a negative number being technically invalid for a two-argument definition of subtraction. Alternatively, you can also define -1 as a single symbol that indicates negative one, not as a negation operation followed by a positive one. These distinctions are for the most part pedantic formalities, but without them you could argue that -1+3+2 evaluated with addition having a higher precedence than subtraction is -(1+3+2) = -6. Defining negation as a separate operation with higher precedence than addition or subtraction, or just saying it's subtraction and all subtraction has higher prexedence than addition, or saying that -1 is a single symbol, all instead give you your expected answer of 4. Isn't that interesting?

[–] Feathercrown@lemmy.world 1 points 2 days ago

I'm honestly disappointed that you just downvoted and left. Challenging your beliefs with contrary ideas is the only way to improve them and understand the world in a more comprehensive and accurate way.

load more comments (6 replies)
load more comments (6 replies)
load more comments (6 replies)