• GreyBeard@lemmy.one
    link
    fedilink
    English
    arrow-up
    7
    ·
    edit-2
    3 days ago

    To expand on what superkret said, in math there is the concept of “order of operations”. That is to say, every function in math (add, multiply, divide) has to be done in a specific order. Since multiplication comes before addition and subtraction, if you have a formula like a-x*b-x, you will do x*b first, then a minus the result of x*b, which would give a very different result than if you did a-x and multiplied that by b-x. This is where the parenthesis come in. You are basically saying, resolve every section in parenthesis first using the proper order, then resolve the rest.

    My original example (a)(b) was over simplified, because there is no conflict there. You can also do things like (a*x)-(b*x). If there is no operator though, it is assumed multiplication, and I’m unsure why that is.

    • starman2112
      link
      fedilink
      English
      arrow-up
      4
      ·
      edit-2
      3 days ago

      Putting multiple asterisks in a comment makes it look italicized, at least on some Lemmy clients. If you want to have asterisks with *unitalicized* text, you gotta put a \ behind the * to negate the change