summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2016-03-31 16:58:19 -0600
committerCharles Harris <charlesr.harris@gmail.com>2016-03-31 16:58:19 -0600
commit2af06c804931aae4b30bb3349bc60271b0b65381 (patch)
treec56e63a8b68cefe66c817de183965d3cc99081ab /numpy
parent25d60a989766e630b92a79284388845ade96d3d0 (diff)
parent9fba2cb5ebddd4790be60801aa0aa62027fbfd02 (diff)
downloadnumpy-2af06c804931aae4b30bb3349bc60271b0b65381.tar.gz
Merge pull request #7489 from anntzer/faster-real-if-close
Faster real_if_close.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/lib/type_check.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/type_check.py b/numpy/lib/type_check.py
index 1313adff7..d6e0704ad 100644
--- a/numpy/lib/type_check.py
+++ b/numpy/lib/type_check.py
@@ -424,7 +424,7 @@ def real_if_close(a,tol=100):
from numpy.core import getlimits
f = getlimits.finfo(a.dtype.type)
tol = f.eps * tol
- if _nx.allclose(a.imag, 0, atol=tol):
+ if _nx.all(_nx.absolute(a.imag) < tol):
a = a.real
return a