extend methods of decimal module

Mark H. Harris harrismh777 at gmail.com
Fri Feb 28 20:39:11 CET 2014


On Friday, February 28, 2014 1:34:27 AM UTC-6, Steven D'Aprano wrote:

> Now that Python has a fast C implementation of Decimal, I would be happy 
> for Python 4000 to default to decimal floats, and require special syntax 
> for binary floats. Say, 0.1b if you want a binary float, and 0.1 for a 
> decimal.
> 
> Steven

Just a side note on how fast... Stefan Krah's performance specs state 120x improvement on many multiplication computations (like PI for instance)...  well, its not hype.

On my P7350 dual core 2Ghz Intel box (2009 mac mini) running Gnu/Linux, I used the piagm(n) AGM routine from my dmath.py library to benchmark against my own C routines, BC, and a couple of other math packages.  The results were phenomenal...  my processor is a low-end gem as compared to modern SOTA processors out there, and even yet:

 1 million digits of PI ---  13 minutes
10 million digits of PI ---  3 hours  55 minutes

Those were new digit/time PRs for me, by-the-by...   and the other methods I've used don't even come close...  so,  Stefan is doing some kind of transform in "decimal" over and above just compiling the extension in C  that is really speeding things up quite a bit.

(that was just a random side note, sorry)



More information about the Python-list mailing list