emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106205: Add doc-strings to some cl f


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106205: Add doc-strings to some cl float parameters.
Date: Thu, 27 Oct 2011 00:21:00 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106205
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Thu 2011-10-27 00:21:00 -0700
message:
  Add doc-strings to some cl float parameters.
  
  * lisp/emacs-lisp/cl-extra.el (cl-float-limits): Add doc string.
  * lisp/emacs-lisp/cl.el (most-positive-float, most-negative-float)
  (least-positive-float, least-negative-float)
  (least-positive-normalized-float, least-negative-normalized-float)
  (float-epsilon, float-negative-epsilon): Add doc-strings,
  based on those in cl.texi.
  
  * lisp/emacs-lisp/cl-extra.el (most-positive-float, most-negative-float)
  (least-positive-float, least-negative-float)
  (least-positive-normalized-float, least-negative-normalized-float)
  (float-epsilon, float-negative-epsilon):
  Remove unnecessary declarations.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/cl-extra.el
  lisp/emacs-lisp/cl.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-10-27 06:38:32 +0000
+++ b/lisp/ChangeLog    2011-10-27 07:21:00 +0000
@@ -1,5 +1,18 @@
 2011-10-27  Glenn Morris  <address@hidden>
 
+       * emacs-lisp/cl-extra.el (most-positive-float, most-negative-float)
+       (least-positive-float, least-negative-float)
+       (least-positive-normalized-float, least-negative-normalized-float)
+       (float-epsilon, float-negative-epsilon):
+       Remove unnecessary declarations.
+
+       * emacs-lisp/cl-extra.el (cl-float-limits): Add doc string.
+       * emacs-lisp/cl.el (most-positive-float, most-negative-float)
+       (least-positive-float, least-negative-float)
+       (least-positive-normalized-float, least-negative-normalized-float)
+       (float-epsilon, float-negative-epsilon): Add doc-strings,
+       based on those in cl.texi.
+
        * files.el (set-visited-file-name): If the major-mode changed,
        reload the local variables.  (Bug#9796)
 

=== modified file 'lisp/emacs-lisp/cl-extra.el'
--- a/lisp/emacs-lisp/cl-extra.el       2011-02-25 03:27:45 +0000
+++ b/lisp/emacs-lisp/cl-extra.el       2011-10-27 07:21:00 +0000
@@ -480,17 +480,13 @@
        (and (numberp res) (/= res (/ res 2)) res))
     (arith-error nil)))
 
-(defvar most-positive-float)
-(defvar most-negative-float)
-(defvar least-positive-float)
-(defvar least-negative-float)
-(defvar least-positive-normalized-float)
-(defvar least-negative-normalized-float)
-(defvar float-epsilon)
-(defvar float-negative-epsilon)
-
 ;;;###autoload
 (defun cl-float-limits ()
+  "Initialize the Common Lisp floating-point parameters.
+This sets the values of: `most-positive-float', `most-negative-float',
+`least-positive-float', `least-negative-float', `float-epsilon',
+`float-negative-epsilon', `least-positive-normalized-float', and
+`least-negative-normalized-float'."
   (or most-positive-float (not (numberp '2e1))
       (let ((x '2e0) y z)
        ;; Find maximum exponent (first two loops are optimizations)

=== modified file 'lisp/emacs-lisp/cl.el'
--- a/lisp/emacs-lisp/cl.el     2011-04-01 15:16:50 +0000
+++ b/lisp/emacs-lisp/cl.el     2011-10-27 07:21:00 +0000
@@ -333,15 +333,51 @@
 
 (defvar *random-state* (vector 'cl-random-state-tag -1 30 (cl-random-time)))
 
-;; The following are actually set by cl-float-limits.
-(defconst most-positive-float nil)
-(defconst most-negative-float nil)
-(defconst least-positive-float nil)
-(defconst least-negative-float nil)
-(defconst least-positive-normalized-float nil)
-(defconst least-negative-normalized-float nil)
-(defconst float-epsilon nil)
-(defconst float-negative-epsilon nil)
+(defconst 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.
+Call `cl-float-limits' to set this.")
+
+(defconst most-negative-float nil
+  "The largest negative value that a Lisp float can hold.
+This is simply -`most-negative-float'.
+Call `cl-float-limits' to set this.")
+
+(defconst 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.
+Call `cl-float-limits' to set this.")
+
+(defconst least-negative-float nil
+  "The smallest value less than zero that a Lisp float can hold.
+This is simply -`least-positive-float'.
+Call `cl-float-limits' to set this.")
+
+(defconst 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 `least-positive-float'.
+Call `cl-float-limits' to set this.")
+
+(defconst least-negative-normalized-float nil
+  "The smallest normalized Lisp float less than zero.
+This is simply -`least-positive-normalized-float'.
+Call `cl-float-limits' to set this.")
+
+(defconst 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.
+Call `cl-float-limits' to set this.")
+
+(defconst 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.
+Call `cl-float-limits' to set this.")
 
 
 ;;; Sequence functions.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]