summaryrefslogtreecommitdiff
path: root/src/fns.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-06-01 03:38:24 +0000
committerRichard M. Stallman <rms@gnu.org>1993-06-01 03:38:24 +0000
commitd28c4332f58a978177ca3c7a80c7999614695077 (patch)
treed2ae092c786ac18ea5486bf73d87fc80b740711d /src/fns.c
parentf526b95587c92c411d42e8bc3d6881d97a341db5 (diff)
downloademacs-d28c4332f58a978177ca3c7a80c7999614695077.tar.gz
(internal_equal): Don't let ints be equal to floats.
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fns.c b/src/fns.c
index c9c7444f603..97f3606bc01 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -820,7 +820,9 @@ DEFUN ("equal", Fequal, Sequal, 2, 2, 0,
They must have the same data type.\n\
Conses are compared by comparing the cars and the cdrs.\n\
Vectors and strings are compared element by element.\n\
-Numbers are compared by value. Symbols must match exactly.")
+Numbers are compared by value, but integers cannot equal floats.\n\
+ (Use `=' if you want integers and floats to be able to be equal.)\n\
+Symbols must match exactly.")
(o1, o2)
register Lisp_Object o1, o2;
{
@@ -838,10 +840,8 @@ do_cdr:
QUIT;
if (EQ (o1, o2)) return Qt;
#ifdef LISP_FLOAT_TYPE
- if (NUMBERP (o1) && NUMBERP (o2))
- {
- return (extract_float (o1) == extract_float (o2)) ? Qt : Qnil;
- }
+ if (FLOATP (o1) && FLOATP (o2))
+ return (extract_float (o1) == extract_float (o2)) ? Qt : Qnil;
#endif
if (XTYPE (o1) != XTYPE (o2)) return Qnil;
if (XTYPE (o1) == Lisp_Cons