diff options
author | chebee7i <chebee7i@gmail.com> | 2015-02-22 18:01:28 -0600 |
---|---|---|
committer | chebee7i <chebee7i@gmail.com> | 2015-02-22 18:01:28 -0600 |
commit | a3b7aa5bfe632fa70be805e20876c62b97a6c4ec (patch) | |
tree | af39787293c941698c9b6f64f0d2db9a65752f16 /numpy/core/numeric.py | |
parent | c2681a55c2c833b0a57deefc5fe2f23b01b0f26d (diff) | |
download | numpy-a3b7aa5bfe632fa70be805e20876c62b97a6c4ec.tar.gz |
MAINT: Minor code edits.
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 1dba8af6a..aa68c94dc 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -2337,10 +2337,11 @@ def isclose(a, b, rtol=1.e-5, atol=1.e-8, equal_nan=False): x = array(a, copy=False, subok=True, ndmin=1) y = array(b, copy=False, subok=True, ndmin=1) - # make sure y is an inexact type to avoid abs(MIN_INT); will cause - # casting of x later. Make sure to allow subclasses (e.g., for numpy.ma). - dtype = multiarray.result_type(y, 1.) - y = array(y, dtype=dtype, copy=False, subok=True) + # Make sure y is an inexact type to avoid bad behavior on abs(MIN_INT). + # This will cause casting of x later. Also, make sure to allow subclasses + # (e.g., for numpy.ma). + dt = multiarray.result_type(y, 1.) + y = array(y, dtype=dt, copy=False, subok=True) xfin = isfinite(x) yfin = isfinite(y) |