(x, prec=53, rnd=round_fast)
return from_man_exp(int(m*(1<<53)), e-53, prec, rnd)
Create a raw mpf from a Python float, rounding if necessary.
    If prec >= 53, the result is guaranteed to represent exactly the
    same number as the input. If prec is not specified, use prec=53.
Create a raw mpf from a Python float, rounding if necessary.
    If prec >= 53, the result is guaranteed to represent exactly the
    same number as the input. If prec is not specified, use prec=53.
Create a raw mpf from a Python float rounding if necessary . If prec > = 53 the result is guaranteed to represent exactly the same number as the input . If prec is not specified use prec = 53 .
def from_float(x, prec=53, rnd=round_fast):
    """Create a raw mpf from a Python float, rounding if necessary.
    If prec >= 53, the result is guaranteed to represent exactly the
    same number as the input. If prec is not specified, use prec=53."""
    # frexp only raises an exception for nan on some platforms
    if x != x:
        return fnan
    # in Python2.5 math.frexp gives an exception for float infinity
    # in Python2.6 it returns (float infinity, 0)
    try:
        m, e = math.frexp(x)
    except:
        if x == math_float_inf: return finf
        if x == -math_float_inf: return fninf
        return fnan
    if x == math_float_inf: return finf
    if x == -math_float_inf: return fninf
    return from_man_exp(int(m*(1<<53)), e-53, prec, rnd)
def from_float ( x , prec = 53 , rnd = round_fast ) : # frexp only raises an exception for nan on some platforms if x != x : return fnan # in Python2.5 math.frexp gives an exception for float infinity # in Python2.6 it returns (float infinity, 0) try : m , e = math . frexp ( x ) except : if x == math_float_inf : return finf if x == - math_float_inf : return fninf return fnan if x == math_float_inf : return finf if x == - math_float_inf : return fninf return from_man_exp ( int ( m * ( 1 << 53 ) ) , e - 53 , prec , rnd )