summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorjaimefrio <jaime.frio@gmail.com>2014-09-25 16:08:50 -0700
committerjaimefrio <jaime.frio@gmail.com>2014-09-25 16:50:27 -0700
commita90ee32f7261b2c8fae17613d8c64e1c5a6d6f1c (patch)
tree1c328a0227acbff66530c8370bc5db83083e4a29 /numpy
parent4acc527c0220c2b3cb04b14424bb70cbd98ce336 (diff)
downloadnumpy-a90ee32f7261b2c8fae17613d8c64e1c5a6d6f1c.tar.gz
ENH: better handling of NaNs in logaddexp
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/npymath/npy_math.c.src8
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/core/src/npymath/npy_math.c.src b/numpy/core/src/npymath/npy_math.c.src
index 6eceecfcf..ba5c58fb4 100644
--- a/numpy/core/src/npymath/npy_math.c.src
+++ b/numpy/core/src/npymath/npy_math.c.src
@@ -546,7 +546,7 @@ double npy_log2(double x)
@type@ npy_logaddexp@c@(@type@ x, @type@ y)
{
if (x == y) {
- /* Handles infinites of the same sign without warnings */
+ /* Handles infinities of the same sign without warnings */
return x + LOGE2;
}
else {
@@ -559,7 +559,7 @@ double npy_log2(double x)
}
else {
/* NaNs */
- return x + y;
+ return tmp;
}
}
}
@@ -567,7 +567,7 @@ double npy_log2(double x)
@type@ npy_logaddexp2@c@(@type@ x, @type@ y)
{
if (x == y) {
- /* Handles infinites of the same sign without warnings */
+ /* Handles infinities of the same sign without warnings */
return x + 1;
}
else {
@@ -580,7 +580,7 @@ double npy_log2(double x)
}
else {
/* NaNs */
- return x + y;
+ return tmp;
}
}
}