summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-07-31 22:23:12 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-07-31 22:23:12 +0000
commitba7e34fde1cdb7b32993a1a913249f4257f51c2e (patch)
treee436a8619317101b22cb616803c0565bcde5a416
parent3f18558a00bd4567989ef7086f8a84168e2b4752 (diff)
downloadnumpy-ba7e34fde1cdb7b32993a1a913249f4257f51c2e.tar.gz
Revert change and add better test for umath
-rw-r--r--numpy/core/tests/test_umath.py4
-rw-r--r--numpy/linalg/linalg.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py
index 814bce85d..13a1ce31e 100644
--- a/numpy/core/tests/test_umath.py
+++ b/numpy/core/tests/test_umath.py
@@ -172,7 +172,9 @@ class _test_complex_real(NumpyTestCase):
'log10']
def test_it(self):
for fun in self.funcs:
- assert_almost_equal(fun(self.x),fun(self.z).real)
+ cr = fun(self.z)
+ assert_almost_equal(fun(self.x),cr.real)
+ assert_almost_equal(0, cr.imag)
class test_choose(NumpyTestCase):
def test_attributes(self):
diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py
index d1de7fea2..244d82cf0 100644
--- a/numpy/linalg/linalg.py
+++ b/numpy/linalg/linalg.py
@@ -430,7 +430,7 @@ def svd(a, full_matrices=1, compute_uv=1):
work = zeros((lwork,), t)
results = lapack_routine(option, m, n, a, m, s, u, m, vt, nvt,
work, -1, iwork, 0)
- lwork = int(work[0])
+ lwork = int(abs(work[0]))
if option == 'N' and lwork==1:
# there seems to be a bug in dgesdd of lapack
# (NNemec, 060310)