(s, t)
return 1
Compare the raw mpfs s and t. Return -1 if s < t, 0 if s == t,
    and 1 if s > t. (Same convention as Python's cmp() function.)
Compare the raw mpfs s and t. Return -1 if s < t, 0 if s == t,
    and 1 if s > t. (Same convention as Python's cmp() function.)
Compare the raw mpfs s and t . Return - 1 if s < t 0 if s == t and 1 if s > t . ( Same convention as Python s cmp () function . )
def mpf_cmp(s, t):
    """Compare the raw mpfs s and t. Return -1 if s < t, 0 if s == t,
    and 1 if s > t. (Same convention as Python's cmp() function.)"""

    # In principle, a comparison amounts to determining the sign of s-t.
    # A full subtraction is relatively slow, however, so we first try to
    # look at the components.
    ssign, sman, sexp, sbc = s
    tsign, tman, texp, tbc = t

    # Handle zeros and special numbers
    if not sman or not tman:
        if s == fzero: return -mpf_sign(t)
        if t == fzero: return mpf_sign(s)
        if s == t: return 0
        # Follow same convention as Python's cmp for float nan
        if t == fnan: return 1
        if s == finf: return 1
        if t == fninf: return 1
        return -1
    # Different sides of zero
    if ssign != tsign:
        if not ssign: return 1
        return -1
    # This reduces to direct integer comparison
    if sexp == texp:
        if sman == tman:
            return 0
        if sman > tman:
            if ssign: return -1
            else:     return 1
        else:
            if ssign: return 1
            else:     return -1
    # Check position of the highest set bit in each number. If
    # different, there is certainly an inequality.
    a = sbc + sexp
    b = tbc + texp
    if ssign:
        if a < b: return 1
        if a > b: return -1
    else:
        if a < b: return -1
        if a > b: return 1

    # Both numbers have the same highest bit. Subtract to find
    # how the lower bits compare.
    delta = mpf_sub(s, t, 5, round_floor)
    if delta[0]:
        return -1
    return 1
def mpf_cmp ( s , t ) : # In principle, a comparison amounts to determining the sign of s-t. # A full subtraction is relatively slow, however, so we first try to # look at the components. ssign , sman , sexp , sbc = s tsign , tman , texp , tbc = t # Handle zeros and special numbers if not sman or not tman : if s == fzero : return - mpf_sign ( t ) if t == fzero : return mpf_sign ( s ) if s == t : return 0 # Follow same convention as Python's cmp for float nan if t == fnan : return 1 if s == finf : return 1 if t == fninf : return 1 return - 1 # Different sides of zero if ssign != tsign : if not ssign : return 1 return - 1 # This reduces to direct integer comparison if sexp == texp : if sman == tman : return 0 if sman > tman : if ssign : return - 1 else : return 1 else : if ssign : return 1 else : return - 1 # Check position of the highest set bit in each number. If # different, there is certainly an inequality. a = sbc + sexp b = tbc + texp if ssign : if a < b : return 1 if a > b : return - 1 else : if a < b : return - 1 if a > b : return 1 # Both numbers have the same highest bit. Subtract to find # how the lower bits compare. delta = mpf_sub ( s , t , 5 , round_floor ) if delta [ 0 ] : return - 1 return 1