774
Stop using floats (lemmy.world)
you are viewing a single comment's thread
view the rest of the comments
[-] Psythik@lemmy.world 14 points 1 year ago

While we're at it, what the hell is -0 and how does it differ from 0?

[-] computerscientistI@lemm.ee 2 points 1 year ago

For integers it really doesn't exist. An algorithm for multiplying an integer with -1 is: Invert all bits and add 1 to the right-most bit. You can do that for 0 of course, it won't hurt.

this post was submitted on 26 Feb 2024
774 points (100.0% liked)

Programmer Humor

25104 readers
1672 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS