ANN: BigDecimal - decimal arithmetic on very large intergers

M.-A. Lemburg mal at egenix.com
Fri Apr 1 08:27:07 EST 2005


casevh at comcast.net wrote:
> BigDecimal is a Python class that supports decimal arithmetic on very large integers. BigDecimal was inspired by the posting of BigDec to c.l.py by Tim Peters. BigDecimal implements all the commonly used integer methods. (It doesn't implement any of the binary/shifting operations.) 
> 
> It has been optimized for performance. It uses a 4x4 Toom-Cook algorithm for multiplication and a new, very fast, division algorithm. If GMPY is available, it will be automatically used.
> 
> Performance examples, computing the decimal represendation of the 42nd Mersenne prime:
>     2**25964951 - 1
> 
> Tim Peter's posting to c.l.py: 13 minutes 41 seconds
> BigDecimal: 59 seconds
> BigDecimal w/gmpy: 10 seconds

You might want to look into mxNumber (part of the egenix-mx-experimental
package):

	http://www.egenix.com/files/python/mxNumber.html

There's a C type called Integer in that package that basically
wraps the GMP integer type.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Apr 01 2005)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::



More information about the Python-list mailing list