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)
Common post-processing for attempts at creating new volumes from other
dataset/ETHPy150Open fredrik-johansson/mpmath/mpmath/libmp/libmpf.py/from_float--crossover with--dataset/ETHPy150Open ClusterHQ/flocker/flocker/volume/filesystems/zfs.py/StoragePool._created