def __hash__(s): a, b = s._mpq_ if b == 1: return hash(a) # Power of two: mpf compatible hash if not (b & (b - 1)): return mpf_hash(from_man_exp(a, 1 - bitcount(b))) return hash((a, b))
def __hash__(s): a, b = s._mpq_ if b == 1: return hash(a) # Power of two: mpf compatible hash if not (b & (b-1)): return mpf_hash(from_man_exp(a, 1-bitcount(b))) return hash((a,b))
def __hash__(s): return mpf_hash(s._mpf_)
def __hash__(s): return mpf_hash(s._mpf_) def __int__(s): return int(to_int(s._mpf_))