"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "mpmath/functions/functions.py" between
mpmath-0.18.tar.gz and mpmath-0.19.tar.gz

About: mpmath is a Python library for arbitrary-precision floating-point arithmetic.

functions.py  (mpmath-0.18):functions.py  (mpmath-0.19)
skipping to change at line 511 skipping to change at line 511
return z**s return z**s
if z == 0: return z*s if z == 0: return z*s
if s == 0: return ctx.expm1(z) if s == 0: return ctx.expm1(z)
if s == 1: return ctx.exp(z)*z if s == 1: return ctx.exp(z)*z
if s == 2: return ctx.exp(z)*z*(z+1) if s == 2: return ctx.exp(z)*z*(z+1)
return _polyexp(ctx, s, z) return _polyexp(ctx, s, z)
@defun_wrapped @defun_wrapped
def cyclotomic(ctx, n, z): def cyclotomic(ctx, n, z):
n = int(n) n = int(n)
assert n >= 0 if n < 0:
raise ValueError("n cannot be negative")
p = ctx.one p = ctx.one
if n == 0: if n == 0:
return p return p
if n == 1: if n == 1:
return z - p return z - p
if n == 2: if n == 2:
return z + p return z + p
# Use divisor product representation. Unfortunately, this sometimes # Use divisor product representation. Unfortunately, this sometimes
# includes singularities for roots of unity, which we have to cancel out. # includes singularities for roots of unity, which we have to cancel out.
# Matching zeros/poles pairwise, we have (1-z^a)/(1-z^b) ~ a/b + O(z-1). # Matching zeros/poles pairwise, we have (1-z^a)/(1-z^b) ~ a/b + O(z-1).
 End of changes. 1 change blocks. 
1 lines changed or deleted 2 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS