Am Montag, 3. März 2014 12:34:30 UTC+1 schrieb Mark H. Harris:
> hi folks,
> 
> 
> 
> Python Decimal Library dmath.py v0.3 Released
> 
> 
> 
> https://code.google.com/p/pythondecimallibrary/
> 
> 
> 
> This code provides the C accelerated decimal module with 
> 
> scientific/transcendental functions for arbitrary precision. 
> 
> I have also included pilib.py which is a PI library of historic
> 
> algorithms for generating PI, which uses dmath.py. 
> 
> 
> 
> I wish to thank Oscar, Wolfgang, Steven, Chris (and others)
> 
> for the help you gave me understanding decimal, particularly
> 
> format, rounding, and context managers. 
> 

Hi Marcus and thanks for the acknowledgement.
Here's one more suggestion for your code.
Your current implementation of fact() for calculating factorials has nothing to 
offer that isn't provided by math.factorial. Since this is all about Decimal 
calculations, shouldn't you modify it to something like:

def fact(x):
    """ fact(x)    factorial    {x} int x > 0        

            (x must be integral)
    """    
    return +Decimal(math.factorial(x))

to make it return a Decimal rounded to context precision?
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to