Trev13@programming.dev to Programming@programming.dev · 2 months agoBig Decimals: Stop Using Floats or Cents for Moneymedium.comexternal-linkmessage-square17linkfedilinkarrow-up10arrow-down10
arrow-up10arrow-down1external-linkBig Decimals: Stop Using Floats or Cents for Moneymedium.comTrev13@programming.dev to Programming@programming.dev · 2 months agomessage-square17linkfedilink
minus-squareTreczoks@lemmy.worldlinkfedilinkarrow-up1·2 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-squareentwine@programming.devlinkfedilinkarrow-up1·2 months agoThere’s a good documentary about this.
minus-squareMonkderVierte@lemmy.ziplinkfedilinkarrow-up0·2 months agoAnd KSP (rocket exploding game) had ten years worth of floating point errors.
minus-squareTreczoks@lemmy.worldlinkfedilinkarrow-up1·2 months agoLike Minecraft has, too. Just go on a long, long walk in one direction.
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.
There’s a good documentary about this.
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.