8000 MAINT: Use NPY_NAN* instead of NAN. · numpy/numpy@5c010e6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5c010e6

Browse files
MAINT: Use NPY_NAN* instead of NAN.
With some compilers, NAN is expanded to an expression that is evaluated at runtime. That can cause various floating point exception flags to be set, including FE_OVERFLOW.
1 parent 91568d6 commit 5c010e6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

numpy/_core/src/umath/funcs.inc.src

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ npy_ObjectClip(PyObject *arr, PyObject *min, PyObject *max) {
268268
* #ctype = npy_cfloat, npy_cdouble, npy_clongdouble#
269269
* #ftype = npy_float, npy_double, npy_longdouble#
270270
* #c = f, ,l#
271+
* #C = F, ,L#
271272
*/
272273

273274
static void
@@ -321,8 +322,8 @@ nc_log1p@c@(@ctype@ *x, @ctype@ *r)
321322
* +/- pi, otherwise it is +/- 0.0 (i.e. same as x_im).
322323
*/
323324
if (npy_isnan(x_re)) {
324-
npy_csetreal@c@(r, NAN);
325-
npy_csetimag@c@(r, NAN);
325+
npy_csetreal@c@(r, NPY_NAN@C@);
326+
npy_csetimag@c@(r, NPY_NAN@C@);
326327
}
327328
else if (x_re >= -1) {
328329
/*

0 commit comments

Comments
 (0)
0