nifty@lemmy.world to Programmer Humor@programming.dev · 9 months agoStop using floatslemmy.worldimagemessage-square82fedilinkarrow-up1784arrow-down135
arrow-up1749arrow-down1imageStop using floatslemmy.worldnifty@lemmy.world to Programmer Humor@programming.dev · 9 months agomessage-square82fedilink
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.
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.