On Fri, 8 Apr 2022 at 03:16, Christopher Barker <python...@gmail.com> wrote:
> I'm no accountant, but this strikes me as quite dangerous -- sure decimal 
> fractions are exact, but who says you are only doing decimal arithmetic? 
> Calculating interest, inflation, who knows what could easily introduce 
> non-exactly-representable-in-decimal numbers. And do accounting systems 
> really use floating point decimal dollars, rather than, say fixed point or 
> integer cents? I also notice that in the financial world, there's a lot of 
> use of binary fractions: interest rates tend to be in eights of a percent, 
> not tenths of a percent, for example.
>

Good question; but I do know that one limitation of the classic "use
integer cents for money" solution is that you can't do forex that way.
Right now, for instance, one AUD is worth 0.74770 USD (although while
I typed that, it changed to 0.74773 USD). Would have to ask someone in
high finance about that; do they think in terms of fixed point still
(ie there's always precisely 1000 subdivisions of a cent), or do they
think in terms of individual transactions ("here, I'll sell you
29_852_359 AUD, you give me 22_320_610 USD") and what we call exchange
rates is all just rounded anyway?

Decimal floating-point certainly has its uses, but it isn't the
perfect solution to all things financial.

But then, NOTHING is the perfect solution to all things financial, as
evidenced by the state of the world we're in....

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/RLAWMUZ5JX4E3WBWHWBROIFTJTJXNLLW/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to