diff options
author | David Cournapeau <cournape@gmail.com> | 2008-08-25 22:06:08 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-08-25 22:06:08 +0000 |
commit | 96bcaf6272b1045bd766025163837d3083503f1f (patch) | |
tree | 48a0c0dcc98870786e7a2c2bcf9efaede524d588 /numpy | |
parent | 1ea236076f6d03896a3fb72d706264648e51d959 (diff) | |
download | numpy-96bcaf6272b1045bd766025163837d3083503f1f.tar.gz |
Use trunc as fix implementation.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/lib/ufunclike.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/numpy/lib/ufunclike.py b/numpy/lib/ufunclike.py index 37c38e94e..2f5de2c37 100644 --- a/numpy/lib/ufunclike.py +++ b/numpy/lib/ufunclike.py @@ -11,17 +11,8 @@ import numpy.core.umath as umath def fix(x, y=None): """ Round x to nearest integer towards zero. """ - x = asanyarray(x) - if y is None: - y = nx.floor(x) - else: - nx.floor(x, y) - if x.ndim == 0: - if (x<0): - y += 1 - else: - y[x<0] = y[x<0]+1 - return y + # fix is now implemented in C, using the C99 trunc function. + return umath.trunc(x, y) def isposinf(x, y=None): """ |