aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2018-04-02 12:19:00 -0700
committerPaul Eggert2018-04-02 12:19:34 -0700
commitdfa922dd844c7af966a42b949aee32248ce4e8a2 (patch)
tree6498abf6cbf9585bd1b76cd4158b13a6c786854e
parente3525385a87c92fdca6b3cf929797a731c688a3f (diff)
downloademacs-dfa922dd844c7af966a42b949aee32248ce4e8a2.tar.gz
emacs-dfa922dd844c7af966a42b949aee32248ce4e8a2.zip
Clarify eq on floats
* doc/lispref/objects.texi (Equality Predicates): Say that two floats with the same values might or might not be eq.
-rw-r--r--doc/lispref/objects.texi10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi
index af740625adb..78a7dccc88d 100644
--- a/doc/lispref/objects.texi
+++ b/doc/lispref/objects.texi
@@ -2083,6 +2083,10 @@ strings), two arguments with the same contents or elements are not
2083necessarily @code{eq} to each other: they are @code{eq} only if they 2083necessarily @code{eq} to each other: they are @code{eq} only if they
2084are the same object, meaning that a change in the contents of one will 2084are the same object, meaning that a change in the contents of one will
2085be reflected by the same change in the contents of the other. 2085be reflected by the same change in the contents of the other.
2086For other types of objects whose contents cannot be changed (e.g.,
2087floats), two arguments with the same contents might or might not be
2088the same object, and @code{eq} returns @code{t} or @code{nil}
2089depending on whether the Lisp interpreter created one object or two.
2086 2090
2087@example 2091@example
2088@group 2092@group
@@ -2096,6 +2100,12 @@ be reflected by the same change in the contents of the other.
2096@end group 2100@end group
2097 2101
2098@group 2102@group
2103(eq 3.0 3.0)
2104 @result{} t @r{or} nil
2105;; @r{The result is implementation-dependent.}
2106@end group
2107
2108@group
2099(eq "asdf" "asdf") 2109(eq "asdf" "asdf")
2100 @result{} nil 2110 @result{} nil
2101@end group 2111@end group