emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 2c242cb: * src/fns.c (Feql, Fequal): Improve floati


From: Paul Eggert
Subject: [Emacs-diffs] master 2c242cb: * src/fns.c (Feql, Fequal): Improve floating-point doc.
Date: Fri, 20 Jul 2018 16:56:08 -0400 (EDT)

branch: master
commit 2c242cb1a2956ecfa894d0110b837d4ecc43a69c
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    * src/fns.c (Feql, Fequal): Improve floating-point doc.
---
 src/fns.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/fns.c b/src/fns.c
index 7d120a9..e7424c3 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2193,8 +2193,10 @@ The PLIST is modified by side effects.  */)
 }
 
 DEFUN ("eql", Feql, Seql, 2, 2, 0,
-       doc: /* Return t if the two args are the same Lisp object.
-Floating-point numbers of equal value are `eql', but they may not be `eq'.  */)
+       doc: /* Return t if the two args are `eq' or are indistinguishable 
numbers.
+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.  */)
   (Lisp_Object obj1, Lisp_Object obj2)
 {
   if (FLOATP (obj1))
@@ -2208,8 +2210,8 @@ DEFUN ("equal", Fequal, Sequal, 2, 2, 0,
 They must have the same data type.
 Conses are compared by comparing the cars and the cdrs.
 Vectors and strings are compared element by element.
-Numbers are compared by value, but integers cannot equal floats.
- (Use `=' if you want integers and floats to be able to be equal.)
+Numbers are compared via `eql', so integers do not equal floats.
+\(Use `=' if you want integers and floats to be able to be equal.)
 Symbols must match exactly.  */)
   (Lisp_Object o1, Lisp_Object o2)
 {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]