[octcvs] Oct commit: oct qdfun.lisp
rtoy
rtoy at commonlisp.net
Wed Oct 10 15:21:47 UTC 2007
Update of /project/oct/cvsroot/oct
In directory clnet:/tmp/cvsserv22545
Modified Files:
qdfun.lisp
Log Message:
o Move logbfinite before first use.
o Declare arg as doublefloat, not float.
 /project/oct/cvsroot/oct/qdfun.lisp 2007/09/12 02:31:14 1.80
+++ /project/oct/cvsroot/oct/qdfun.lisp 2007/10/10 15:21:47 1.81
@@ 34,6 +34,17 @@
(inpackage #:qdi)
+(defun logbfinite (x)
+ "Same as logb but X is not infinity and nonzero and not a NaN, so
+that we can always return an integer"
+ (declare (type cl:doublefloat x))
+ (multiplevaluebind (signif expon sign)
+ (cl:decodefloat x)
+ (declare (ignore signif sign))
+ ;; decodefloat is almost right, except that the exponent
+ ;; is off by one
+ (1 expon)))
+
#+cmu
(declaim (maybeinline sqrtqd))
(defun sqrtqd (a)
@@ 69,17 +80,6 @@
(setf r (addqd r (mulqd r (subdqd half (mulqd h (sqrqd r)))))))
(scalefloatqd (mulqd r newa) (ash k 1)))))
(defun logbfinite (x)
 "Same as logb but X is not infinity and nonzero and not a NaN, so
that we can always return an integer"
 (declare (type cl:float x))
 (multiplevaluebind (signif expon sign)
 (cl:decodefloat x)
 (declare (ignore signif sign))
 ;; decodefloat is almost right, except that the exponent
 ;; is off by one
 (1 expon)))

(defun hypotauxqd (x y)
(declare (type %quaddouble x y))
(let ((k ( (logbfinite (max (cl:abs (qd0 x))
More information about the octcvs
mailing list