[git] CMU Common Lisp branch master updated. snapshot-2014-09-12-g2451162
Raymond Toy
rtoy at common-lisp.net
Sat Sep 20 20:50:55 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 24511623e8c3ba1752339d2613bbd18ef27859b0 (commit)
from 32ad743155af81b7c3e2ee31726272a85e8f3247 (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 24511623e8c3ba1752339d2613bbd18ef27859b0
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Sat Sep 20 13:50:47 2014 -0700
Add fdlibm's log10.
* src/code/irrat.lisp:
* Define %log10 to use fdlibm's log10
* src/lisp/GNUmakefile
* Compile e_log10
* tests/trig.lisp
* Add tests for %log10.
diff --git a/src/code/irrat.lisp b/src/code/irrat.lisp
index 2591907..61d4314 100644
--- a/src/code/irrat.lisp
+++ b/src/code/irrat.lisp
@@ -81,7 +81,7 @@
;;; Exponential and Logarithmic.
(def-math-rtn ("__ieee754_exp" %exp) 1)
(def-math-rtn ("__ieee754_log" %log) 1)
-(def-math-rtn "log10" 1)
+(def-math-rtn ("__ieee754_log10" %log10) 1)
(def-math-rtn ("__ieee754_pow" %pow) 2)
#-(or x86 sparc-v7 sparc-v8 sparc-v9)
diff --git a/src/lisp/GNUmakefile b/src/lisp/GNUmakefile
index c557d3b..d0d6104 100644
--- a/src/lisp/GNUmakefile
+++ b/src/lisp/GNUmakefile
@@ -12,6 +12,7 @@ FDLIBM = k_sin.c k_cos.c k_tan.c s_sin.c s_cos.c s_tan.c sincos.c \
e_acosh.c s_asinh.c e_atanh.c \
e_atan2.c \
e_rem_pio2.c k_rem_pio2.c \
+ e_log10.c \
setexception.c
SRCS = lisp.c coreparse.c alloc.c monitor.c print.c interr.c \
diff --git a/tests/trig.lisp b/tests/trig.lisp
index 861a298..cdebe39 100644
--- a/tests/trig.lisp
+++ b/tests/trig.lisp
@@ -1006,3 +1006,24 @@
(assert-true (ext:float-nan-p (kernel:%atan *qnan*)))
(kernel::with-float-traps-masked (:invalid)
(assert-true (ext:float-nan-p (kernel:%atan *snan*)))))
+
+(define-test %log10.exceptions
+ (:tag :fdlibm)
+ ;; %log10(2^k) = k
+ (dotimes (k 23)
+ (assert-equalp k
+ (kernel:%log10 (float (expt 10 k) 1d0))))
+ (assert-error 'division-by-zero
+ (kernel:%log10 0d0))
+ (assert-error 'floating-point-invalid-operation
+ (kernel:%log10 -1d0))
+ (assert-true (ext:float-nan-p (kernel:%log10 *qnan*)))
+ (assert-equal ext:double-float-positive-infinity
+ (kernel:%log10 ext:double-float-positive-infinity))
+ (kernel::with-float-traps-masked (:divide-by-zero)
+ (assert-equal ext:double-float-negative-infinity
+ (kernel:%log10 0d0))
+ (assert-equal ext:double-float-negative-infinity
+ (kernel:%log10 -0d0)))
+ (kernel::with-float-traps-masked (:invalid)
+ (assert-true (ext:float-nan-p (kernel:%log10 -1d0)))))
-----------------------------------------------------------------------
Summary of changes:
src/code/irrat.lisp | 2 +-
src/lisp/GNUmakefile | 1 +
tests/trig.lisp | 21 +++++++++++++++++++++
3 files changed, 23 insertions(+), 1 deletion(-)
hooks/post-receive
--
CMU Common Lisp
More information about the cmucl-cvs
mailing list