Mercurial > emacs
changeset 6201:d71dedd123c1
(isnan): New macro.
(float_arith_driver): min and max yield NaN if any argument is a NaN.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Fri, 04 Mar 1994 21:21:08 +0000 |
parents | 01c57ae8ca57 |
children | 5442ffe004ec |
files | src/data.c |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/data.c Fri Mar 04 09:30:58 1994 +0000 +++ b/src/data.c Fri Mar 04 21:21:08 1994 +0000 @@ -1650,6 +1650,10 @@ } #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 @@ 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; }