Ejemplo n.º 1
0
 def bernoulli(ctx, n):
     cache = ctx._bernoulli_cache
     if n in cache:
         return cache[n]
     cache[n] = to_float(mpf_bernoulli(n, 53, "n"), strict=True)
     return cache[n]
Ejemplo n.º 2
0
 def __float__(s):
     return to_float(s._mpf_)
Ejemplo n.º 3
0
 def bernoulli(ctx, n):
     cache = ctx._bernoulli_cache
     if n in cache:
         return cache[n]
     cache[n] = to_float(mpf_bernoulli(n, 53, 'n'), strict=True)
     return cache[n]
Ejemplo n.º 4
0
 def __float__(s): return to_float(s._mpf_)
 def __complex__(s): return complex(float(s))