math module for Decimals

Fredrik Johansson fredrik.johansson at gmail.com
Tue Jan 6 10:23:10 EST 2009


On Dec 28 2008, 4:55 pm, jerry.carl... at gmail.com wrote:
> > - are you usingDecimalfor the base-10-ness or the
> >   extra precisionDecimalprovides?  Or significant zeros?
> >   Or compatibility with existingDecimalcode, or what?
>
> Oh boy, now I will finally prove myself illiterate... well, so be it.
> But i am after the extra precision:
>
> >>> from math import *
> >>> (1+1e-16)-1
>
> 0.0

>
> Agree: sin, cos and atan would do it.

FYI, mpmath (http://code.google.com/p/mpmath/) implements arbitrary-
precision standard transcendental functions in pure Python. It is much
faster than decimal, dmath, decimalfuncs and AJDecimalMathAdditions,
and handles huge arguments just fine.

Fredrik



More information about the Python-list mailing list