[cmucl-commit] [git] CMU Common Lisp branch master updated. snapshot-2014-09-26-g6f1c1c5
Raymond Toy
rtoy at common-lisp.net
Wed Oct 1 04:12:59 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 6f1c1c59b5e719143012ac7b217458953f2a0bed (commit)
via 098f3c14711de24cfeb3ce6a74bca320fd8e2aa1 (commit)
from f61fb8591ba745046f96770093330be7d12e45d2 (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 6f1c1c59b5e719143012ac7b217458953f2a0bed
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Tue Sep 30 21:12:52 2014 -0700
Add tests for kernel:%scalbn.
diff --git a/tests/trig.lisp b/tests/trig.lisp
index cdebe39..86fdb39 100644
--- a/tests/trig.lisp
+++ b/tests/trig.lisp
@@ -1027,3 +1027,32 @@
(kernel:%log10 -0d0)))
(kernel::with-float-traps-masked (:invalid)
(assert-true (ext:float-nan-p (kernel:%log10 -1d0)))))
+
+(define-test %scalbn.exceptions
+ (:tag :fdlibm)
+ (let ((modes (ext:get-floating-point-modes)))
+ (unwind-protect
+ (progn
+ (ext:set-floating-point-modes :traps '(:underflow))
+ (assert-error 'floating-point-underflow
+ (kernel:%scalbn 1d0 -51000)))
+ (apply #'ext:set-floating-point-modes modes)))
+ (assert-true 0d0
+ (kernel:%scalbn 1d0 -51000))
+ (assert-true -0d0
+ (kernel:%scalbn -1d0 -51000))
+ (assert-error 'floating-point-overflow
+ (kernel:%scalbn ext:double-float-positive-infinity 1))
+ (assert-error 'floating-point-invalid-operation
+ (kernel:%scalbn *snan* 1))
+ (assert-error 'floating-point-overflow
+ (kernel:%scalbn most-positive-double-float 2))
+ (assert-error 'floating-point-overflow
+ (kernel:%scalbn most-negative-double-float 2))
+ (kernel::with-float-traps-masked (:overflow)
+ (assert-equal ext:double-float-positive-infinity
+ (kernel:%scalbn ext:double-float-positive-infinity 1))
+ (assert-equal ext:double-float-positive-infinity
+ (kernel:%scalbn most-positive-double-float 2))
+ (assert-equal ext:double-float-negative-infinity
+ (kernel:%scalbn most-negative-double-float 2))))
commit 098f3c14711de24cfeb3ce6a74bca320fd8e2aa1
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Tue Sep 30 21:12:37 2014 -0700
Add alien interface to scalbn.
diff --git a/src/code/irrat.lisp b/src/code/irrat.lisp
index c07e979..8ddd413 100644
--- a/src/code/irrat.lisp
+++ b/src/code/irrat.lisp
@@ -91,6 +91,12 @@
(def-math-rtn ("fdlibm_log1p" %log1p) 1)
(def-math-rtn ("fdlibm_expm1" %expm1) 1)
+(declaim (inline %scalbn))
+(export '%scalbn)
+(alien:def-alien-routine ("fdlibm_scalbn" %scalbn) c-call:double
+ (x double-float)
+ (n c-call:int))
+
;; These are needed for use by byte-compiled files. But don't use
;; these with sse2 since we don't support using the x87 instructions
;; here.
-----------------------------------------------------------------------
Summary of changes:
src/code/irrat.lisp | 6 ++++++
tests/trig.lisp | 29 +++++++++++++++++++++++++++++
2 files changed, 35 insertions(+)
hooks/post-receive
--
CMU Common Lisp
More information about the cmucl-commit
mailing list