diff options
| author | Paul Eggert | 2019-11-10 15:01:06 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-11-10 15:04:20 -0800 |
| commit | b6942c0c37a504e00c717c8c74bfa9dcd208c931 (patch) | |
| tree | 40565eb305e75021b6d96e90fd678c87a9de10be /lisp | |
| parent | 6ad5eb97940b07bf8d28f8517608351b3af1221c (diff) | |
| download | emacs-b6942c0c37a504e00c717c8c74bfa9dcd208c931.tar.gz emacs-b6942c0c37a504e00c717c8c74bfa9dcd208c931.zip | |
Document Lisp floats a bit better
* doc/lispref/numbers.texi (Float Basics):
* doc/misc/cl.texi (Implementation Parameters):
* lisp/emacs-lisp/cl-lib.el (cl-most-positive-float)
(cl-least-positive-float)
(cl-least-positive-normalized-float, cl-float-epsilon)
(cl-float-negative-epsilon):
Document IEEE floating point better. Don’t suggest that Emacs
might use some floating-point format other than IEEE format, as
Emacs currently assumes IEEE in several places and there seems
little point in removing those assumptions.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/emacs-lisp/cl-lib.el | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index ff096918173..7d0df27e14b 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el | |||
| @@ -299,7 +299,7 @@ If true return the decimal value of digit CHAR in RADIX." | |||
| 299 | (defconst cl-most-positive-float nil | 299 | (defconst cl-most-positive-float nil |
| 300 | "The largest value that a Lisp float can hold. | 300 | "The largest value that a Lisp float can hold. |
| 301 | If your system supports infinities, this is the largest finite value. | 301 | If your system supports infinities, this is the largest finite value. |
| 302 | For IEEE machines, this is approximately 1.79e+308. | 302 | For Emacs, this equals 1.7976931348623157e+308. |
| 303 | Call `cl-float-limits' to set this.") | 303 | Call `cl-float-limits' to set this.") |
| 304 | 304 | ||
| 305 | (defconst cl-most-negative-float nil | 305 | (defconst cl-most-negative-float nil |
| @@ -309,8 +309,8 @@ Call `cl-float-limits' to set this.") | |||
| 309 | 309 | ||
| 310 | (defconst cl-least-positive-float nil | 310 | (defconst cl-least-positive-float nil |
| 311 | "The smallest value greater than zero that a Lisp float can hold. | 311 | "The smallest value greater than zero that a Lisp float can hold. |
| 312 | For IEEE machines, it is about 4.94e-324 if denormals are supported, | 312 | For Emacs, this equals 5e-324 if subnormal numbers are supported, |
| 313 | or 2.22e-308 if they are not. | 313 | `cl-least-positive-normalized-float' if they are not. |
| 314 | Call `cl-float-limits' to set this.") | 314 | Call `cl-float-limits' to set this.") |
| 315 | 315 | ||
| 316 | (defconst cl-least-negative-float nil | 316 | (defconst cl-least-negative-float nil |
| @@ -320,10 +320,8 @@ Call `cl-float-limits' to set this.") | |||
| 320 | 320 | ||
| 321 | (defconst cl-least-positive-normalized-float nil | 321 | (defconst cl-least-positive-normalized-float nil |
| 322 | "The smallest normalized Lisp float greater than zero. | 322 | "The smallest normalized Lisp float greater than zero. |
| 323 | This is the smallest value for which IEEE denormalization does not lose | 323 | This is the smallest value that has full precision. |
| 324 | precision. For IEEE machines, this value is about 2.22e-308. | 324 | For Emacs, this equals 2.2250738585072014e-308. |
| 325 | For machines that do not support the concept of denormalization | ||
| 326 | and gradual underflow, this constant equals `cl-least-positive-float'. | ||
| 327 | Call `cl-float-limits' to set this.") | 325 | Call `cl-float-limits' to set this.") |
| 328 | 326 | ||
| 329 | (defconst cl-least-negative-normalized-float nil | 327 | (defconst cl-least-negative-normalized-float nil |
| @@ -334,12 +332,12 @@ Call `cl-float-limits' to set this.") | |||
| 334 | (defconst cl-float-epsilon nil | 332 | (defconst cl-float-epsilon nil |
| 335 | "The smallest positive float that adds to 1.0 to give a distinct value. | 333 | "The smallest positive float that adds to 1.0 to give a distinct value. |
| 336 | Adding a number less than this to 1.0 returns 1.0 due to roundoff. | 334 | Adding a number less than this to 1.0 returns 1.0 due to roundoff. |
| 337 | For IEEE machines, epsilon is about 2.22e-16. | 335 | For Emacs, this equals 2.220446049250313e-16. |
| 338 | Call `cl-float-limits' to set this.") | 336 | Call `cl-float-limits' to set this.") |
| 339 | 337 | ||
| 340 | (defconst cl-float-negative-epsilon nil | 338 | (defconst cl-float-negative-epsilon nil |
| 341 | "The smallest positive float that subtracts from 1.0 to give a distinct value. | 339 | "The smallest positive float that subtracts from 1.0 to give a distinct value. |
| 342 | For IEEE machines, it is about 1.11e-16. | 340 | For Emacs, this equals 1.1102230246251565e-16. |
| 343 | Call `cl-float-limits' to set this.") | 341 | Call `cl-float-limits' to set this.") |
| 344 | 342 | ||
| 345 | 343 | ||