(fixed)
return f
Create a function that computes the mpf value for a mathematical
    constant, given a function that computes the fixed-point value.

    Assumptions: the constant is positive and has magnitude ~= 1;
    the fixed-point function rounds to floor.
Create a function that computes the mpf value for a mathematical
    constant, given a function that computes the fixed-point value.
Create a function that computes the mpf value for a mathematical constant given a function that computes the fixed - point value .
def def_mpf_constant(fixed):
    """
    Create a function that computes the mpf value for a mathematical
    constant, given a function that computes the fixed-point value.

    Assumptions: the constant is positive and has magnitude ~= 1;
    the fixed-point function rounds to floor.
    """
    def f(prec, rnd=round_fast):
        wp = prec + 20
        v = fixed(wp)
        if rnd in (round_up, round_ceiling):
            v += 1
        return normalize(0, v, -wp, bitcount(v), prec, rnd)
    f.__doc__ = fixed.__doc__
    return f
def def_mpf_constant ( fixed ) : def f ( prec , rnd = round_fast ) : wp = prec + 20 v = fixed ( wp ) if rnd in ( round_up , round_ceiling ) : v += 1 return normalize ( 0 , v , - wp , bitcount ( v ) , prec , rnd ) f . __doc__ = fixed . __doc__ return f