Commit 1a2f2d33 authored by Karl Heuer's avatar Karl Heuer
Browse files

(isnan): New macro.

(float_arith_driver): min and max yield NaN if any argument is a NaN.
parent cffa74ea
......@@ -1650,6 +1650,10 @@ arith_driver (code, nargs, args)
}
#ifdef LISP_FLOAT_TYPE
#undef isnan
#define isnan(x) ((x) != (x))
Lisp_Object
float_arith_driver (accum, argnum, code, nargs, args)
double accum;
......@@ -1707,11 +1711,11 @@ float_arith_driver (accum, argnum, code, nargs, args)
case Alogxor:
return wrong_type_argument (Qinteger_or_marker_p, val);
case Amax:
if (!argnum || next > accum)
if (!argnum || isnan (next) || next > accum)
accum = next;
break;
case Amin:
if (!argnum || next < accum)
if (!argnum || isnan (next) || next < accum)
accum = next;
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment