# HG changeset patch # User Aidan Kehoe # Date 1301416114 -3600 # Node ID 436e67ca8c790dd9214e1a5eb72d4ab9a050df4b # Parent 3889ef1284884c2ddf74627d4bad2764dc18529e Give docstrings to least-{positive,negative}-normalized-float, float-*epsilon 2011-03-29 Aidan Kehoe * 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 + + * 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 * 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.