(x)
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
Convert x = y*2**n to (y, n) with abs(y) in [0.5, 1) if nonzero
Convert x = y * 2 ** n to ( y n ) with abs ( y ) in [ 0 . 5 1 ) if nonzero
def mpf_frexp(x):
    """Convert x = y*2**n to (y, n) with abs(y) in [0.5, 1) if nonzero"""
    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
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