summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-07-31 22:05:49 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-07-31 22:05:49 +0000
commit3f18558a00bd4567989ef7086f8a84168e2b4752 (patch)
tree81ca9e33df76543e5e338230ac1805358a3b9783
parentb3eb6e239bc365106824fe69eed76408e43274b5 (diff)
downloadnumpy-3f18558a00bd4567989ef7086f8a84168e2b4752.tar.gz
Add test for ufunc complex-problems fixed in previous commit.
-rw-r--r--numpy/core/tests/test_umath.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py
index 3f6b43734..814bce85d 100644
--- a/numpy/core/tests/test_umath.py
+++ b/numpy/core/tests/test_umath.py
@@ -163,6 +163,17 @@ class test_choose(NumpyTestCase):
assert_equal(choose(c, (a, 1)), array([1,1]))
+class _test_complex_real(NumpyTestCase):
+ def setUp(self):
+ self.x = 0.52
+ self.z = self.x+0j
+ self.funcs = ['arcsin', 'arccos', 'arctan', 'arcsinh', 'arccosh',
+ 'arctanh', 'sin', 'cos', 'tan', 'exp', 'log', 'sqrt',
+ 'log10']
+ def test_it(self):
+ for fun in self.funcs:
+ assert_almost_equal(fun(self.x),fun(self.z).real)
+
class test_choose(NumpyTestCase):
def test_attributes(self):
add = ncu.add