[oct-cvs] Oct commit: oct qd-fun.lisp
rtoy
rtoy at common-lisp.net
Wed Oct 10 15:21:47 UTC 2007
Update of /project/oct/cvsroot/oct
In directory clnet:/tmp/cvs-serv22545
Modified Files:
qd-fun.lisp
Log Message:
o Move logb-finite before first use.
o Declare arg as double-float, not float.
--- /project/oct/cvsroot/oct/qd-fun.lisp 2007/09/12 02:31:14 1.80
+++ /project/oct/cvsroot/oct/qd-fun.lisp 2007/10/10 15:21:47 1.81
@@ -34,6 +34,17 @@
(in-package #:qdi)
+(defun logb-finite (x)
+ "Same as logb but X is not infinity and non-zero and not a NaN, so
+that we can always return an integer"
+ (declare (type cl:double-float x))
+ (multiple-value-bind (signif expon sign)
+ (cl:decode-float x)
+ (declare (ignore signif sign))
+ ;; decode-float is almost right, except that the exponent
+ ;; is off by one
+ (1- expon)))
+
#+cmu
(declaim (maybe-inline sqrt-qd))
(defun sqrt-qd (a)
@@ -69,17 +80,6 @@
(setf r (add-qd r (mul-qd r (sub-d-qd half (mul-qd h (sqr-qd r)))))))
(scale-float-qd (mul-qd r new-a) (ash k -1)))))
-(defun logb-finite (x)
- "Same as logb but X is not infinity and non-zero and not a NaN, so
-that we can always return an integer"
- (declare (type cl:float x))
- (multiple-value-bind (signif expon sign)
- (cl:decode-float x)
- (declare (ignore signif sign))
- ;; decode-float is almost right, except that the exponent
- ;; is off by one
- (1- expon)))
-
(defun hypot-aux-qd (x y)
(declare (type %quad-double x y))
(let ((k (- (logb-finite (max (cl:abs (qd-0 x))
More information about the oct-cvs
mailing list