• Saledovil@sh.itjust.works
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      edit-2
      10 hours ago

      If you multiply a negative number with a negative number you get a positive number.

      Edit: Sorry, misread your comment, I clearly didn’t get enough sleep. In printed mathematics, the unary minus sign has a lower precedence than the exponent, but in programming, it’s the other way around, with the unary minus being applied first. So your right in printed mathematics, but wrong in programming.

      • Charzard4261@programming.dev
        link
        fedilink
        English
        arrow-up
        10
        ·
        8 hours ago

        No they’re wrong in mathematics too. -5^2 is -25, but -5^2 is not the same as x^2 where x= -5. No brackets needed on x.

      • gigachad@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        arrow-down
        7
        ·
        edit-2
        10 hours ago

        Well that is not debatable, I am talking about the difference between -5² = -25 and (-5)² = 25

        • reliv3@lemmy.world
          link
          fedilink
          arrow-up
          7
          arrow-down
          1
          ·
          edit-2
          8 hours ago

          Open desmos. Graph y = x^2. Then graph y = (x)^2. Recognize that both graphs are identical. Realize the flaw in your argument.