Decimal arithmetic, with example code

Chris Gonnerman chris.gonnerman at newcenturycomputers.net
Mon Sep 30 22:12:00 EDT 2002


Ok, here it is.  I have written some Python code which
displays the problems with float (floating binary)
arithmetic applied to monetary amounts.  Run this, and
many the places where the simple percentage times
amount calculation in floating binary falls down will
become obvious.

You need the fixedpoint.py module installed to run this.

    http://fixedpoint.sourceforge.net

(code attached)

Chris Gonnerman -- chris.gonnerman at newcenturycomputers.net
http://newcenturycomputers.net
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fp-test.py
URL: <http://mail.python.org/pipermail/python-list/attachments/20020930/9f24f73d/attachment.ksh>


More information about the Python-list mailing list