From 96bcaf6272b1045bd766025163837d3083503f1f Mon Sep 17 00:00:00 2001 From: David Cournapeau Date: Mon, 25 Aug 2008 22:06:08 +0000 Subject: Use trunc as fix implementation. --- numpy/lib/ufunclike.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'numpy/lib/ufunclike.py') 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): """ -- cgit v1.2.1