diff options
author | Darren Dale <dsdale24@gmail.com> | 2010-04-18 14:02:31 +0000 |
---|---|---|
committer | Darren Dale <dsdale24@gmail.com> | 2010-04-18 14:02:31 +0000 |
commit | 26d51fb2bf1ae6bb0f2c5f164647ee4a572b8d10 (patch) | |
tree | e200d7c27628438ba34f310e0013646fa0fdf5fb /numpy | |
parent | fcc0b79de4ae35548dbc711c9273ecd875764ccd (diff) | |
download | numpy-26d51fb2bf1ae6bb0f2c5f164647ee4a572b8d10.tar.gz |
correct a bug in fix() that was introduced in r8293
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/lib/tests/test_ufunclike.py | 1 | ||||
-rw-r--r-- | numpy/lib/ufunclike.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/numpy/lib/tests/test_ufunclike.py b/numpy/lib/tests/test_ufunclike.py index 00c81bf43..e9c41d09c 100644 --- a/numpy/lib/tests/test_ufunclike.py +++ b/numpy/lib/tests/test_ufunclike.py @@ -48,6 +48,7 @@ class TestUfunclike(TestCase): res = ufl.fix(a, out) assert_equal(res, tgt) assert_equal(out, tgt) + assert_equal(ufl.fix(3.14), 3) def test_fix_with_subclass(self): class MyArray(nx.ndarray): diff --git a/numpy/lib/ufunclike.py b/numpy/lib/ufunclike.py index 734fd08be..8f81fe4b2 100644 --- a/numpy/lib/ufunclike.py +++ b/numpy/lib/ufunclike.py @@ -44,7 +44,7 @@ def fix(x, y=None): y1 = nx.floor(x) y2 = nx.ceil(x) if y is None: - y = y1 + y = nx.asanyarray(y1) y[...] = nx.where(x >= 0, y1, y2) return y |