[SciPy-user] help with precision for big numbers

Lev Givon lev at columbia.edu
Tue May 13 10:28:56 EDT 2008


Received from Damian Eads on Tue, May 13, 2008 at 05:32:33AM EDT:

(snip)

> The limit of precision of floating point numbers in native Python is 
> 32-bit. Numpy defines extra scalar types and you will find most of the 
> ones supported by your machine in the numpy package. np.float64 will 
> give you 64-bit precision. There is a np.float96 for 96-bit floats but 
> I've never used it before.
> 

128-bit floats are also available on certain machines.

> Damian

Although it isn't as fast as similar packages, mpmath is useful if one
occasionally needs to handle arbitrary precision in Python -
especially considering that it provides a number of special functions
(like gamma and factorial) apart from the usual transcendentals:

http://code.google.com/p/mpmath

							L.G.



More information about the SciPy-User mailing list