changeset: 5385:436e67ca8c79
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Tue Mar 29 17:28:34 2011 +0100
files: lisp/ChangeLog lisp/cl.el
description:
Give docstrings to least-{positive,negative}-normalized-float, float-*epsilon
2011-03-29 Aidan Kehoe <kehoea(a)parhasard.net>
* cl.el:
* cl.el (least-positive-float):
* cl.el (least-positive-normalized-float):
* cl.el (least-negative-normalized-float):
* cl.el (float-epsilon):
* cl.el (float-negative-epsilon):
Document some previously-undocumented float constants here.
* cl.el (oddp):
* cl.el (evenp):
Change numeric comparison to use #'eql instead of #'eq in
passing.
diff -r 3889ef128488 -r 436e67ca8c79 lisp/ChangeLog
--- a/lisp/ChangeLog Thu Mar 24 11:00:11 2011 -0600
+++ b/lisp/ChangeLog Tue Mar 29 17:28:34 2011 +0100
@@ -1,3 +1,17 @@
+2011-03-29 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl.el:
+ * cl.el (least-positive-float):
+ * cl.el (least-positive-normalized-float):
+ * cl.el (least-negative-normalized-float):
+ * cl.el (float-epsilon):
+ * cl.el (float-negative-epsilon):
+ Document some previously-undocumented float constants here.
+ * cl.el (oddp):
+ * cl.el (evenp):
+ Change numeric comparison to use #'eql instead of #'eq in
+ passing.
+
2011-03-24 Jerry James <james(a)xemacs.org>
* cl-macs.el (loop): "arbitary" -> "arbitrary".
diff -r 3889ef128488 -r 436e67ca8c79 lisp/cl.el
--- a/lisp/cl.el Thu Mar 24 11:00:11 2011 -0600
+++ b/lisp/cl.el Tue Mar 29 17:28:34 2011 +0100
@@ -312,11 +312,11 @@
(defun oddp (integer)
"Return t if INTEGER is odd."
- (eq (logand integer 1) 1))
+ (eql (logand integer 1) 1))
(defun evenp (integer)
"Return t if INTEGER is even."
- (eq (logand integer 1) 0))
+ (eql (logand integer 1) 0))
;; XEmacs addition
(defalias 'cl-abs 'abs)
@@ -329,13 +329,35 @@
(defconst most-negative-float nil
"The float closest in value to negative infinity.")
(defconst least-positive-float nil
- "The positive float closest in value to 0.")
+ "The positive float closest in value to zero.")
(defconst least-negative-float nil
- "The negative float closest in value to 0.")
-(defconst least-positive-normalized-float nil)
-(defconst least-negative-normalized-float nil)
-(defconst float-epsilon nil)
-(defconst float-negative-epsilon nil)
+ "The negative float closest in value to zero.")
+(defconst least-positive-normalized-float nil
+ "The normalized positive float closest in value to zero.
+
+A float is normalized if the most significant bit of its mantissa is 1.
+Use of denormalized (equivalently, subnormal) floats in calculations will
+lead to gradual underflow, though they can be more accurate in representing
+individual small values. Normal and subnormal floats are as described in
+IEEE 754.")
+
+(defconst least-negative-normalized-float nil
+ "The normalized negative float closest in value to zero.
+
+See `least-positive-normalized-float' for details of normal and denormalized
+numbers.")
+
+(defconst float-epsilon nil
+ "The smallest float guaranteed not `eql' to 1.0 when added to 1.0.
+
+That is, (eql 1.0 (+ 1.0 X)) will always give nil if (<= float-epsilon X) ,
+but it may give t for smaller values.")
+
+(defconst float-negative-epsilon nil
+ "The smallest float guaranteed not `eql' to 1.0 when subtracted from 1.0.
+
+That is, (eql 1.0 (- 1.0 X)) will always give nil if (<=
+float-negative-epsilon X) , but it may give t for smaller values.")
;;; Sequence functions.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches