• LurkingLuddite@piefed.socialBanned
      link
      fedilink
      English
      arrow-up
      7
      ·
      4 months ago

      It’s not. You don’t multiply then divide. It’s more PE-MD-AS. Multiplication and division have the same priority, so are then worked from left to right.

      The correct answer is 8, and only 8.

    • Kogasa@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      4 months ago

      No it does not. If you treat implicit multiplication (no symbol) as exactly the same precedence as explicit, it’d be 8. Sometimes people intend it to have a higher priority, especially when it’s after a division sign because they’re thinking about how they’d write it on paper, as a fraction. For example, you might see 1/ab instead of 1/(ab). Strictly applying PEMDAS would say 1/ab = b/a, but if that’s what you meant then you probably would have written b/a instead.

      If you do the implicit multiplication first, it’s 0.5.