diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2009-12-07 18:19:10 +0000 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2009-12-07 18:19:10 +0000 |
commit | f5c5c6d3b1e7e090c3bdf92cf8139355993a1c06 (patch) | |
tree | 2d9f05f660b7193294b74444ba5bed17e0e19932 | |
parent | 4cdc1e1b644cfcce88cb12c94c7ddcc03b64c4a0 (diff) | |
download | numpy-f5c5c6d3b1e7e090c3bdf92cf8139355993a1c06.tar.gz |
Remove reliance on integer division by zero returning zero.
-rw-r--r-- | numpy/polynomial/chebyshev.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/polynomial/chebyshev.py b/numpy/polynomial/chebyshev.py index 4bd0a90f6..42d7db018 100644 --- a/numpy/polynomial/chebyshev.py +++ b/numpy/polynomial/chebyshev.py @@ -277,7 +277,9 @@ def _zseries_int(zs) : n = 1 + len(zs)//2 ns = np.array([-1, 0, 1], dtype=zs.dtype) zs = _zseries_mul(zs, ns) - zs /= np.arange(-n, n+1)*2 + div = np.arange(-n, n+1)*2 + zs[:n] /= div[:n] + zs[n+1:] /= div[n+1:] zs[n] = 0 return zs |