nifty to Programmer Humor@programming.dev • 11 months agoStop using floatslemmy.worldimagemessage-square84fedilinkarrow-up1792arrow-down135
arrow-up1757arrow-down1imageStop using floatslemmy.worldnifty to Programmer Humor@programming.dev • 11 months agomessage-square84fedilink
minus-square@Psythik@lemmy.worldlinkfedilink15•11 months agoWhile we’re at it, what the hell is -0 and how does it differ from 0?
minus-square@ShepherdPie@midwest.sociallinkfedilink5•11 months agoSo it’s just like 0 but with an evil goatee?
minus-square@Knock_Knock_Lemmy_In@lemmy.worldlinkfedilink8•11 months agoLook at the graph of y=tan(x)+ⲡ/2 -0 and +0 are completely different.
minus-square@computerscientistI@lemm.eelinkfedilink2•11 months agoFor 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.
While we’re at it, what the hell is -0 and how does it differ from 0?
It’s the negative version
So it’s just like 0 but with an evil goatee?
Look at the graph of y=tan(x)+ⲡ/2
-0 and +0 are completely different.
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.