mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-28 08:11:05 -08:00
(isnan): New macro.
(float_arith_driver): min and max yield NaN if any argument is a NaN.
This commit is contained in:
parent
cffa74ea6c
commit
1a2f2d332e
1 changed files with 6 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue