Math errors in python

Heiko Wundram heikowu at ceosg.de
Sun Sep 19 14:07:55 CEST 2004


Am Sonntag, 19. September 2004 09:39 schrieb Gary Herron:
> That's called rational arithmetic, and I'm sure you can find a package
> that implements it for you.  However what would you propose for
> irrational numbers like sqrt(2) and transcendental numbers like PI?

Just as an example, try gmpy. Unlimited precision integer and rational 
arithmetic. But don't think that they implement anything more than the four 
basic operations on rationals, because algorithms like sqrt and pow become so 
slow, that nobody sensible would use them, but rather just stick to the 
binary arithmetic the computer uses (although this might have some minor 
effects on precision, but these can be bounded).

Heiko.



More information about the Python-list mailing list