Maths error

Nick Maclaren nmm1 at cus.cam.ac.uk
Tue Jan 9 06:38:09 EST 2007


|> Rory Campbell-Lange wrote:
|> 
|> > Is using the decimal module the best way around this? (I'm
|> > expecting the first sum to match the second). It seem
|> > anachronistic that decimal takes strings as input, though.

As Dan Bishop says, probably not.  The introduction to the decimal
module makes exaggerated claims of accuracy, amounting to propaganda.
It is numerically no better than binary, and has some advantages
and some disadvantages.

|> Also check the recent thread "bizarre floating point output".

No, don't.  That is about another matter entirely, and will merely
confuse you.  I have a course on computer arithmetic, and am just
now writing one on Python numerics, and confused people may contact
me - though I don't guarantee to help.


Regards,
Nick Maclaren.



More information about the Python-list mailing list