Comment

Comment by smallnamespace

I'm curious to hear about your specifics, since I was at a shop where front office used all floats (doubles).

Not sure what the back office did, but I doubt it was all done in arbitrary position arithmetic.

Note that if an accountant says things need to be accurate down to the penny, that's probably an exaggeration [1]. Financial statements are typically rounded to the thousands, e.g. Intel's are rounded to million [2].

The IRS also lets you round off dollars [3].

I agree though that if you're building a large complex system with many coders, and either 1) nobody has a full view of the calculation and can do the numerical analysis or 2) there's a high chance that at some point in the future you need penny-accurate bookkeeping, then it's safer to use a very wide int or float type.

Of course, there's also the case where the accountant or auditor doesn't actually need penny precision, but it's easier to just tell the coder 'just in case'.

[1] https://www.accountingtools.com/articles/2017/5/14/the-mater...

[2] https://s21.q4cdn.com/600692695/files/doc_financials/2017/an...

[3] https://taxmap.irs.gov/taxmap/pub17/p17-006.htm#TXMP5d034bfb

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton