示例#1
0
 def _convert_tol(ctx, tol):
     if isinstance(tol, int_types):
         return from_int(tol)
     if isinstance(tol, float):
         return from_float(tol)
     if hasattr(tol, "_mpf_"):
         return tol._mpf_
     prec, rounding = ctx._prec_rounding
     if isinstance(tol, basestring):
         return from_str(tol, prec, rounding)
     raise ValueError("expected a real number, got %s" % tol)
示例#2
0
 def _convert_tol(ctx, tol):
     if isinstance(tol, int_types):
         return from_int(tol)
     if isinstance(tol, float):
         return from_float(tol)
     if hasattr(tol, "_mpf_"):
         return tol._mpf_
     prec, rounding = ctx._prec_rounding
     if isinstance(tol, basestring):
         return from_str(tol, prec, rounding)
     raise ValueError("expected a real number, got %s" % tol)
示例#3
0
 def _as_mpf_val(self, prec):
     return mlib.from_float(1.05457162e-34, prec)
def test_zeta_int_bug():
    assert mpf_zeta_int(0, 10) == from_float(-0.5)
示例#5
0
 def _as_mpf_val(self, prec):
     return mlib.from_float(1.05457162e-34, prec)
def test_zeta_int_bug():
    assert mpf_zeta_int(0, 10) == from_float(-0.5)