“Tom Scott's fun and simple take on Floating Points is a good video explaining why such weird errors happen”
Fun, simple explanation of why floating point produces weird errors.
Full comment
Recommended: Floating Point Numbers - Computerphile this video Tom Scott's fun and simple take on Floating Points is a good video explaining why such weird errors happen
RecommendsmicrowavecameraJun 2017
“Here's a couple handy videos explaining it”
Handy explanation of why decimals do not work cleanly in binary.
Full comment
Short answer, no decimal in binary and math is hard. :) Here's a couple handy videos explaining it: this videolink
Cites itmercxryOct 2023
“I still wouldn't use floats/numerics/decimals to store currency either in any db generally”
Cited as source for inaccuracy of floats when storing currency.
Full comment
You should still not use MONEY in Postgres, even their own website says so [1]. I still wouldn't use floats/numerics/decimals to store currency either in any db generally, as said by others you're going to end up with inaccurate numbers [2]. Therefore using integers is in fact very good for this use-case, especially if you are in accounting or book-keeping! Source: I work for a Fintech company that processes millions of payments. [1] link [2] this video