Re:Ask HN: How to handle financial calculations precisely?
by fedeb95 on Wednesday January 25, 2023 @04:07PM
(#34524188)
I'm dealing with actual financial data and I don't think there are laws regarding exactly how you should deal with money in terms of specific algorithms. If you have any pointers...
Re:Ask HN: How to handle financial calculations precisely?
by viraptor on Wednesday January 25, 2023 @05:01PM
(#34524762)
Talk to a local accountant. Even if there's no law for your specific situation, there will be one applicable for the country, or at least a known rule everyone follows that's accepted by the local tax org.
So basically there are either rules around the calculation that you're not aware of yet, or you're doing it for some ad-hoc graphs where the answer is "Yolo, just choose some large number for precision".