def mpf_frexp(x):
    sign, man, exp, bc = x
    if not man:
        if x == fzero:
            return (fzero, 0)
        else:
            raise ValueError
    return mpf_shift(x, -bc-exp), bc+exp
Convert x = y*2**n to (y, n) with abs(y) in [0.5, 1) if nonzero
dataset/ETHPy150Open fredrik-johansson/mpmath/mpmath/libmp/libmpf.py/mpf_frexp