EDIT: Thanks to a helpful comment I see why I was wrong.

  • Arkouda@lemmy.caOP
    link
    fedilink
    arrow-up
    1
    arrow-down
    3
    ·
    6 days ago

    Are you trying to tell me that using the order of operations addition is not done before subtraction?

    • AbouBenAdhem@lemmy.world
      cake
      link
      fedilink
      English
      arrow-up
      4
      ·
      6 days ago

      The standard order of operations is

      1. Parentheses
      2. Exponentiation
      3. Multiplication and division
      4. Addition and subtraction.

      The operations on each row are equivalent, and are executed from left to right.

      • Arkouda@lemmy.caOP
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        6 days ago

        Thanks for being helpful. I am not sure how I mixed that up but for some reason in my head I was thinking “Do Addition then (should read “and”) Subtraction in order from left to right”. This is why it is a shower thought and why I am brushing up on my math. haha

        • AbouBenAdhem@lemmy.world
          cake
          link
          fedilink
          English
          arrow-up
          3
          ·
          edit-2
          6 days ago

          If it helps to conceptualize, you can always replace subtraction and division with these equivalents without affecting the order:

          a - b
          = a + -b
          = a + (-1*b)

          and

          a / b
          = a * b-1
          = a * (1/b)