[Cmucl-cvs] [git] CMU Common Lisp branch master updated. snapshot-2014-09-15-g24c656a
Raymond Toy
rtoy at lisp.not.org
Thu Sep 25 02:57:08 UTC 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMU Common Lisp".
The branch, master has been updated
via 24c656a5824bfd4fb9d45dfd88a25f6015e56db4 (commit)
from 106bf4fc7687741b27523b23db3c9b2443237b2d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 24c656a5824bfd4fb9d45dfd88a25f6015e56db4
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Wed Sep 24 19:57:01 2014 -0700
Add tests for compiled log2 and log10.
diff --git a/tests/float.lisp b/tests/float.lisp
index eeb221b..55b9013 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)))))
+
+
+
-----------------------------------------------------------------------
Summary of changes:
tests/float.lisp | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
hooks/post-receive
--
CMU Common Lisp
More information about the cmucl-cvs
mailing list