diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-11-10 15:01:06 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-11-10 15:04:20 -0800 |
commit | b6942c0c37a504e00c717c8c74bfa9dcd208c931 (patch) | |
tree | 40565eb305e75021b6d96e90fd678c87a9de10be /lisp/emacs-lisp/cl-lib.el | |
parent | 6ad5eb97940b07bf8d28f8517608351b3af1221c (diff) | |
download | emacs-b6942c0c37a504e00c717c8c74bfa9dcd208c931.tar.gz |
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/emacs-lisp/cl-lib.el')
-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." (defconst cl-most-positive-float nil "The largest value that a Lisp float can hold. If your system supports infinities, this is the largest finite value. -For IEEE machines, this is approximately 1.79e+308. +For Emacs, this equals 1.7976931348623157e+308. Call `cl-float-limits' to set this.") (defconst cl-most-negative-float nil @@ -309,8 +309,8 @@ Call `cl-float-limits' to set this.") (defconst cl-least-positive-float nil "The smallest value greater than zero that a Lisp float can hold. -For IEEE machines, it is about 4.94e-324 if denormals are supported, -or 2.22e-308 if they are not. +For Emacs, this equals 5e-324 if subnormal numbers are supported, +`cl-least-positive-normalized-float' if they are not. Call `cl-float-limits' to set this.") (defconst cl-least-negative-float nil @@ -320,10 +320,8 @@ Call `cl-float-limits' to set this.") (defconst cl-least-positive-normalized-float nil "The smallest normalized Lisp float greater than zero. -This is the smallest value for which IEEE denormalization does not lose -precision. For IEEE machines, this value is about 2.22e-308. -For machines that do not support the concept of denormalization -and gradual underflow, this constant equals `cl-least-positive-float'. +This is the smallest value that has full precision. +For Emacs, this equals 2.2250738585072014e-308. Call `cl-float-limits' to set this.") (defconst cl-least-negative-normalized-float nil @@ -334,12 +332,12 @@ Call `cl-float-limits' to set this.") (defconst cl-float-epsilon nil "The smallest positive float that adds to 1.0 to give a distinct value. Adding a number less than this to 1.0 returns 1.0 due to roundoff. -For IEEE machines, epsilon is about 2.22e-16. +For Emacs, this equals 2.220446049250313e-16. Call `cl-float-limits' to set this.") (defconst cl-float-negative-epsilon nil "The smallest positive float that subtracts from 1.0 to give a distinct value. -For IEEE machines, it is about 1.11e-16. +For Emacs, this equals 1.1102230246251565e-16. Call `cl-float-limits' to set this.") |