diff options
| -rw-r--r-- | src/data.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/data.c b/src/data.c index 59e9e928d6e..adb8d38e3aa 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -1650,6 +1650,10 @@ arith_driver (code, nargs, args) | |||
| 1650 | } | 1650 | } |
| 1651 | 1651 | ||
| 1652 | #ifdef LISP_FLOAT_TYPE | 1652 | #ifdef LISP_FLOAT_TYPE |
| 1653 | |||
| 1654 | #undef isnan | ||
| 1655 | #define isnan(x) ((x) != (x)) | ||
| 1656 | |||
| 1653 | Lisp_Object | 1657 | Lisp_Object |
| 1654 | float_arith_driver (accum, argnum, code, nargs, args) | 1658 | float_arith_driver (accum, argnum, code, nargs, args) |
| 1655 | double accum; | 1659 | double accum; |
| @@ -1707,11 +1711,11 @@ float_arith_driver (accum, argnum, code, nargs, args) | |||
| 1707 | case Alogxor: | 1711 | case Alogxor: |
| 1708 | return wrong_type_argument (Qinteger_or_marker_p, val); | 1712 | return wrong_type_argument (Qinteger_or_marker_p, val); |
| 1709 | case Amax: | 1713 | case Amax: |
| 1710 | if (!argnum || next > accum) | 1714 | if (!argnum || isnan (next) || next > accum) |
| 1711 | accum = next; | 1715 | accum = next; |
| 1712 | break; | 1716 | break; |
| 1713 | case Amin: | 1717 | case Amin: |
| 1714 | if (!argnum || next < accum) | 1718 | if (!argnum || isnan (next) || next < accum) |
| 1715 | accum = next; | 1719 | accum = next; |
| 1716 | break; | 1720 | break; |
| 1717 | } | 1721 | } |