this post was submitted on 15 May 2025
387 points (97.8% liked)

Funny

9591 readers
1223 users here now

General rules:

Exceptions may be made at the discretion of the mods.

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Saledovil@sh.itjust.works 4 points 2 days ago* (last edited 2 days ago) (2 children)

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 10 points 2 days 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.