aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorPaul Eggert2019-11-10 15:01:06 -0800
committerPaul Eggert2019-11-10 15:04:20 -0800
commitb6942c0c37a504e00c717c8c74bfa9dcd208c931 (patch)
tree40565eb305e75021b6d96e90fd678c87a9de10be /lisp
parent6ad5eb97940b07bf8d28f8517608351b3af1221c (diff)
downloademacs-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.el16
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.
301If your system supports infinities, this is the largest finite value. 301If your system supports infinities, this is the largest finite value.
302For IEEE machines, this is approximately 1.79e+308. 302For Emacs, this equals 1.7976931348623157e+308.
303Call `cl-float-limits' to set this.") 303Call `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.
312For IEEE machines, it is about 4.94e-324 if denormals are supported, 312For Emacs, this equals 5e-324 if subnormal numbers are supported,
313or 2.22e-308 if they are not. 313`cl-least-positive-normalized-float' if they are not.
314Call `cl-float-limits' to set this.") 314Call `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.
323This is the smallest value for which IEEE denormalization does not lose 323This is the smallest value that has full precision.
324precision. For IEEE machines, this value is about 2.22e-308. 324For Emacs, this equals 2.2250738585072014e-308.
325For machines that do not support the concept of denormalization
326and gradual underflow, this constant equals `cl-least-positive-float'.
327Call `cl-float-limits' to set this.") 325Call `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.
336Adding a number less than this to 1.0 returns 1.0 due to roundoff. 334Adding a number less than this to 1.0 returns 1.0 due to roundoff.
337For IEEE machines, epsilon is about 2.22e-16. 335For Emacs, this equals 2.220446049250313e-16.
338Call `cl-float-limits' to set this.") 336Call `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.
342For IEEE machines, it is about 1.11e-16. 340For Emacs, this equals 1.1102230246251565e-16.
343Call `cl-float-limits' to set this.") 341Call `cl-float-limits' to set this.")
344 342
345 343