diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2009-03-09 03:36:49 +0000 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2009-03-09 03:36:49 +0000 |
commit | eefc1417d12af4a5b3bfa11b52ec67b9fff641ad (patch) | |
tree | 7590fef00fe3aba99983020373703c263301e465 /numpy/lib/tests/test_regression.py | |
parent | 4a632534604d686ff9ac5a9629ce06f7c895cd1e (diff) | |
download | numpy-eefc1417d12af4a5b3bfa11b52ec67b9fff641ad.tar.gz |
Fix polyint to work correctly with float, complex, and int inputs.
Fix polydiv to work correctly with float, complex, and int inputs.
Diffstat (limited to 'numpy/lib/tests/test_regression.py')
-rw-r--r-- | numpy/lib/tests/test_regression.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/numpy/lib/tests/test_regression.py b/numpy/lib/tests/test_regression.py index e465dc4b6..e58756b9b 100644 --- a/numpy/lib/tests/test_regression.py +++ b/numpy/lib/tests/test_regression.py @@ -27,8 +27,22 @@ class TestRegression(object): def test_polyint_type(self) : """Ticket #944""" msg = "Wrong type, should be complex" - x = np.polyint(np.ones(3, dtype=np.complex)) - assert_(np.asarray(x).dtype == np.complex, msg) + x = np.ones(3, dtype=np.complex) + assert_(np.polyint(x).dtype == np.complex, msg) + msg = "Wrong type, should be float" + x = np.ones(3, dtype=np.int) + assert_(np.polyint(x).dtype == np.float, msg) + + def test_polydiv_type(self) : + """Make polydiv work for complex types""" + msg = "Wrong type, should be complex" + x = np.ones(3, dtype=np.complex) + q,r = np.polydiv(x,x) + assert_(q.dtype == np.complex, msg) + msg = "Wrong type, should be float" + x = np.ones(3, dtype=np.int) + q,r = np.polydiv(x,x) + assert_(q.dtype == np.float, msg) if __name__ == "__main__": |