diff --git a/tests/float.lisp b/tests/float.lisp index eeb221b1d8664c3596af76b6f7b0d2b7f3cd2e30..55b901334fe1ef6f24b600f5819f623ed6a83cce 100644 --- a/tests/float.lisp +++ b/tests/float.lisp @@ -21,3 +21,25 @@ (let ((x (float (expt 10 k) 1d0))) (assert-equalp k (log x 10))))) +(compile 'clog2 + #'(lambda (x) + (declare (type (double-float (0d0)) x)) + (log x 2))) + +(compile 'clog10 + #'(lambda (x) + (declare (type (double-float (0d0)) x)) + (log x 10))) + +(define-test log2.compiled + (loop for k from -1074 to 1023 do + (let ((x (scale-float 1d0 k))) + (assert-equalp k (clog2 x))))) + +(define-test log10.compiled + (loop for k from 0 to 22 do + (let ((x (float (expt 10 k) 1d0))) + (assert-equalp k (clog10 x))))) + + +