diff options
-rw-r--r-- | doc/lispref/numbers.texi | 4 | ||||
-rw-r--r-- | src/fns.c | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi index f018ef4c7c0..9a5bff5a5b2 100644 --- a/doc/lispref/numbers.texi +++ b/doc/lispref/numbers.texi @@ -450,6 +450,10 @@ numbers. It compares numbers by type and numeric value, so that @code{(eql 1.0 1)} returns @code{nil}, but @code{(eql 1.0 1.0)} and @code{(eql 1 1)} both return @code{t}. This can be used to compare large integers as well as small ones. +Floating-point values with the same sign, exponent and fraction are @code{eql}. +This differs from numeric comparison: @code{(eql 0.0 -0.0)} returns +@code{nil} and @code{(eql 0.0e+NaN 0.0e+NaN)} returns @code{t}, +whereas @code{=} does the opposite. @end defun @defun /= number-or-marker1 number-or-marker2 diff --git a/src/fns.c b/src/fns.c index 4003fe8a818..f50bf8ecb77 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2295,6 +2295,7 @@ The PLIST is modified by side effects. */) DEFUN ("eql", Feql, Seql, 2, 2, 0, doc: /* Return t if the two args are `eq' or are indistinguishable numbers. +Integers with the same value are `eql'. Floating-point values with the same sign, exponent and fraction are `eql'. This differs from numeric comparison: (eql 0.0 -0.0) returns nil and \(eql 0.0e+NaN 0.0e+NaN) returns t, whereas `=' does the opposite. */) |