diff options
| author | Deepak Kumar Gouda <deepakgouda1729@gmail.com> | 2018-01-31 01:05:32 +0530 |
|---|---|---|
| committer | Eric Wieser <wieser.eric@gmail.com> | 2018-01-30 11:35:32 -0800 |
| commit | e988535a06c8150e28e6858d7be0a5d2f7e08fa9 (patch) | |
| tree | dea31043a027674dd305ddce7ebf2aca1eeaa361 /numpy/lib/tests | |
| parent | c3fd79150bc183e8852f1330ea6e8cb4ca7ce7bc (diff) | |
| download | numpy-e988535a06c8150e28e6858d7be0a5d2f7e08fa9.tar.gz | |
BUG: Fixed polydiv for Complex Numbers (#10473)
This previously failed with:
TypeError: Cannot cast ufunc subtract output from dtype('complex128') to dtype('float64') with casting rule 'same_kind'
Diffstat (limited to 'numpy/lib/tests')
| -rw-r--r-- | numpy/lib/tests/test_polynomial.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_polynomial.py b/numpy/lib/tests/test_polynomial.py index 9a4650825..03915cead 100644 --- a/numpy/lib/tests/test_polynomial.py +++ b/numpy/lib/tests/test_polynomial.py @@ -222,6 +222,14 @@ class TestDocs(object): assert_equal(p == p2, False) assert_equal(p != p2, True) + def test_polydiv(self): + b = np.poly1d([2, 6, 6, 1]) + a = np.poly1d([-1j, (1+2j), -(2+1j), 1]) + q, r = np.polydiv(b, a) + assert_equal(q.coeffs.dtype, np.complex128) + assert_equal(r.coeffs.dtype, np.complex128) + assert_equal(q*a + r, b) + def test_poly_coeffs_immutable(self): """ Coefficients should not be modifiable """ p = np.poly1d([1, 2, 3]) |
