This math scares me

jurgen.defurne at philips.com jurgen.defurne at philips.com
Fri Mar 16 02:12:50 EST 2001


grante at visi.com@SMTP at python.org on 15/03/2001 19:20:46
Sent by:	python-list-admin at python.org
To:	python-list at python.org@SMTP
cc:	 
Subject:	Re: This math scares me
Classification:	

In article <98qv55$f5d$1 at news.udel.edu>, Terry Reedy wrote:

>So, .1% gets represented as the binary equivalent of, perhaps,
>.0010000000000000001.
>So the interest on 2,000,000,000 pennies is calculated as
>2000000.0000000002 instead of
>2000000 pennies.  When rounded off, they are the same.  To me, this is, as
>I claimed. 'well enough' (for many purposes, at least), even though not
>'exact'.

If that's good enough for you, then go ahead and use FP.

But, the people who actually write financial SW for a living
seem to think it's not good enough.  You would have to talk to
one of them to find out the exact situations where FP proved
insufficient.


Try summing all financial operations of one day together, or
better, all operations involving percentages and then adding them
together : cumulative errors.

Jurgen




More information about the Python-list mailing list