Trev13@programming.dev to Programming@programming.dev · 5 months agoBig Decimals: Stop Using Floats or Cents for Moneymedium.comexternal-linkmessage-square14linkfedilinkarrow-up10arrow-down10
arrow-up10arrow-down1external-linkBig Decimals: Stop Using Floats or Cents for Moneymedium.comTrev13@programming.dev to Programming@programming.dev · 5 months agomessage-square14linkfedilink
minus-squareTreczoks@lemmy.worldlinkfedilinkarrow-up0·5 months agoI stopped using floats 30 years ago when I learned what rounding errors can do if you only deal with big enough numbers of items to tally. My employer turned around 25M a year, and it had to add up to the cent for the audits.
minus-squareMonkderVierte@lemmy.ziplinkfedilinkarrow-up0·5 months agoAnd KSP (rocket exploding game) had ten years worth of floating point errors.
minus-squareTreczoks@lemmy.worldlinkfedilinkarrow-up0·5 months agoLike Minecraft has, too. Just go on a long, long walk in one direction.
minus-squareentwine@programming.devlinkfedilinkarrow-up0·5 months agoThere’s a good documentary about this.
I stopped using floats 30 years ago when I learned what rounding errors can do if you only deal with big enough numbers of items to tally. My employer turned around 25M a year, and it had to add up to the cent for the audits.
And KSP (rocket exploding game) had ten years worth of floating point errors.
Like Minecraft has, too. Just go on a long, long walk in one direction.
There’s a good documentary about this.