Alex Walters wrote:
Other use case is finance, where you can end up with interest calculations
that are fractional of the base unit of currency.  US$2.345 is impossible to
represent in real currency, so it has to be rounded.

This brings us back to my original point about floating point
accuracy. If you do your interest calculation in floating
point binary, first it's very unlikely that it will come
out ending in exactly 0.5 of a cent, and secondly if you
care about the details that much, you should be calculating
in decimal, and being explicit about exactly what kind of
rounding you're doing.

--
Greg

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to