nifty@lemmy.world to Programmer Humor@programming.dev · 9 months agoStop using floatslemmy.worldimagemessage-square83fedilinkarrow-up1774arrow-down134
arrow-up1740arrow-down1imageStop using floatslemmy.worldnifty@lemmy.world to Programmer Humor@programming.dev · 9 months agomessage-square83fedilink
minus-squarePsythik@lemmy.worldlinkfedilinkarrow-up14·9 months agoWhile we’re at it, what the hell is -0 and how does it differ from 0?
minus-squarecomputerscientistI@lemm.eelinkfedilinkarrow-up2·9 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.
minus-squareShepherdPie@midwest.sociallinkfedilinkarrow-up0·9 months agoSo it’s just like 0 but with an evil goatee?
minus-squareKnock_Knock_Lemmy_In@lemmy.worldlinkfedilinkarrow-up1·9 months agoLook at the graph of y=tan(x)+ⲡ/2 -0 and +0 are completely different.
While we’re at it, what the hell is -0 and how does it differ from 0?
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.
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.