summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2008-08-25 22:06:08 +0000
committerDavid Cournapeau <cournape@gmail.com>2008-08-25 22:06:08 +0000
commit96bcaf6272b1045bd766025163837d3083503f1f (patch)
tree48a0c0dcc98870786e7a2c2bcf9efaede524d588 /numpy
parent1ea236076f6d03896a3fb72d706264648e51d959 (diff)
downloadnumpy-96bcaf6272b1045bd766025163837d3083503f1f.tar.gz
Use trunc as fix implementation.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/lib/ufunclike.py13
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):
"""