diff options
| author | Paul Eggert | 2018-07-20 13:55:12 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-07-20 13:56:00 -0700 |
| commit | 2c242cb1a2956ecfa894d0110b837d4ecc43a69c (patch) | |
| tree | f3b78d34d10e795f3e8493ebc58bb5f3503319ca | |
| parent | de66bfd0f22f0464d8670de9002796192bdc24e3 (diff) | |
| download | emacs-2c242cb1a2956ecfa894d0110b837d4ecc43a69c.tar.gz emacs-2c242cb1a2956ecfa894d0110b837d4ecc43a69c.zip | |
* src/fns.c (Feql, Fequal): Improve floating-point doc.
| -rw-r--r-- | src/fns.c | 10 |
1 files changed, 6 insertions, 4 deletions
| @@ -2193,8 +2193,10 @@ The PLIST is modified by side effects. */) | |||
| 2193 | } | 2193 | } |
| 2194 | 2194 | ||
| 2195 | DEFUN ("eql", Feql, Seql, 2, 2, 0, | 2195 | DEFUN ("eql", Feql, Seql, 2, 2, 0, |
| 2196 | doc: /* Return t if the two args are the same Lisp object. | 2196 | doc: /* Return t if the two args are `eq' or are indistinguishable numbers. |
| 2197 | Floating-point numbers of equal value are `eql', but they may not be `eq'. */) | 2197 | Floating-point values with the same sign, exponent and fraction are `eql'. |
| 2198 | This differs from numeric comparison: (eql 0.0 -0.0) returns nil and | ||
| 2199 | \(eql 0.0e+NaN 0.0e+NaN) returns t, whereas `=' does the opposite. */) | ||
| 2198 | (Lisp_Object obj1, Lisp_Object obj2) | 2200 | (Lisp_Object obj1, Lisp_Object obj2) |
| 2199 | { | 2201 | { |
| 2200 | if (FLOATP (obj1)) | 2202 | if (FLOATP (obj1)) |
| @@ -2208,8 +2210,8 @@ DEFUN ("equal", Fequal, Sequal, 2, 2, 0, | |||
| 2208 | They must have the same data type. | 2210 | They must have the same data type. |
| 2209 | Conses are compared by comparing the cars and the cdrs. | 2211 | Conses are compared by comparing the cars and the cdrs. |
| 2210 | Vectors and strings are compared element by element. | 2212 | Vectors and strings are compared element by element. |
| 2211 | Numbers are compared by value, but integers cannot equal floats. | 2213 | Numbers are compared via `eql', so integers do not equal floats. |
| 2212 | (Use `=' if you want integers and floats to be able to be equal.) | 2214 | \(Use `=' if you want integers and floats to be able to be equal.) |
| 2213 | Symbols must match exactly. */) | 2215 | Symbols must match exactly. */) |
| 2214 | (Lisp_Object o1, Lisp_Object o2) | 2216 | (Lisp_Object o1, Lisp_Object o2) |
| 2215 | { | 2217 | { |