aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-06-01 03:38:24 +0000
committerRichard M. Stallman1993-06-01 03:38:24 +0000
commitd28c4332f58a978177ca3c7a80c7999614695077 (patch)
treed2ae092c786ac18ea5486bf73d87fc80b740711d /src
parentf526b95587c92c411d42e8bc3d6881d97a341db5 (diff)
downloademacs-d28c4332f58a978177ca3c7a80c7999614695077.tar.gz
emacs-d28c4332f58a978177ca3c7a80c7999614695077.zip
(internal_equal): Don't let ints be equal to floats.
Diffstat (limited to 'src')
-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,
820They must have the same data type.\n\ 820They must have the same data type.\n\
821Conses are compared by comparing the cars and the cdrs.\n\ 821Conses are compared by comparing the cars and the cdrs.\n\
822Vectors and strings are compared element by element.\n\ 822Vectors and strings are compared element by element.\n\
823Numbers are compared by value. Symbols must match exactly.") 823Numbers are compared by value, but integers cannot equal floats.\n\
824 (Use `=' if you want integers and floats to be able to be equal.)\n\
825Symbols must match exactly.")
824 (o1, o2) 826 (o1, o2)
825 register Lisp_Object o1, o2; 827 register Lisp_Object o1, o2;
826{ 828{
@@ -838,10 +840,8 @@ do_cdr:
838 QUIT; 840 QUIT;
839 if (EQ (o1, o2)) return Qt; 841 if (EQ (o1, o2)) return Qt;
840#ifdef LISP_FLOAT_TYPE 842#ifdef LISP_FLOAT_TYPE
841 if (NUMBERP (o1) && NUMBERP (o2)) 843 if (FLOATP (o1) && FLOATP (o2))
842 { 844 return (extract_float (o1) == extract_float (o2)) ? Qt : Qnil;
843 return (extract_float (o1) == extract_float (o2)) ? Qt : Qnil;
844 }
845#endif 845#endif
846 if (XTYPE (o1) != XTYPE (o2)) return Qnil; 846 if (XTYPE (o1) != XTYPE (o2)) return Qnil;
847 if (XTYPE (o1) == Lisp_Cons 847 if (XTYPE (o1) == Lisp_Cons