<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
img {
max-width: 100%;
height: auto;
}
p.details {
font-style:italic;
color:#777
}
.footer p {
font-size:small;
color:#777
}
pre.commit-message {
white-space: pre-wrap;
}
.file-stats a {
text-decoration: none;
}
.file-stats .new-file {
color: #090;
}
.file-stats .deleted-file {
color: #B00;
}
</style>
<body>
<div class='content'>
<h3>Raymond Toy pushed to branch master at <a href="https://gitlab.common-lisp.net/cmucl/cmucl">cmucl / cmucl</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/507f6d9e658dd231fb22b84029ffe3aad0eb62a3">507f6d9e</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-22T21:35:14Z</i>
</div>
<pre class='commit-message'>Add inexact exception test for asinh.</pre>
</li>
</ul>
<h4>1 changed file:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
tests/fdlibm.lisp
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/commit/507f6d9e658dd231fb22b84029ffe3aad0eb62a3#diff-0'>
<strong>
tests/fdlibm.lisp
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/fdlibm.lisp
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/fdlibm.lisp
</span><span style="color: #aaaaaa">@@ -14,6 +14,15 @@
</span> (kernel:make-double-float #x7ff00000 1)
"A randon signaling MaN value")
<span style="color: #000000;background-color: #ddffdd">+(defmacro with-inexact-exception-enabled (&body body)
+ (let ((old-modes (gensym "OLD-MODES-")))
+ `(let ((,old-modes (ext:get-floating-point-modes)))
+ (unwind-protect
+ (progn
+ (ext:set-floating-point-modes :traps '(:inexact))
+ ,@body)
+ (apply 'ext:set-floating-point-modes ,old-modes)))))
+
</span> (define-test %cosh.exceptions
(:tag :fdlibm)
(assert-error 'floating-point-overflow
<span style="color: #aaaaaa">@@ -285,10 +294,20 @@
</span> (:tag :fdlibm)
(assert-eql -0d0 (asinh -0d0))
(assert-eql 0d0 (asinh 0d0))
<span style="color: #000000;background-color: #ffdddd">- (let ((x (scale-float 1d0 -29)))
</span><span style="color: #000000;background-color: #ddffdd">+ (let ((x (scale-float 1d0 -29))
+ (x0 0d0))
</span> ;; asinh(x) = x for x < 2^-28
(assert-eql x (asinh x))
<span style="color: #000000;background-color: #ffdddd">- (assert-eql (- x) (asinh (- x))))
</span><span style="color: #000000;background-color: #ddffdd">+ (assert-eql (- x) (asinh (- x)))
+ (with-inexact-exception-enabled
+ ;; This must not throw an inexact exception because the result
+ ;; is exact when the arg is 0.
+ (assert-eql 0d0 (asinh x0)))
+ (with-inexact-exception-enabled
+ ;; This must throw an inexact exception for non-zero x even
+ ;; though the result is exactly x.
+ (assert-error 'floating-point-inexact
+ (asinh x))))
</span> (let ((x (scale-float 1d0 -28)))
;; Case 2 > |x| >= 2^-28
(assert-eql 3.725290298461914d-9 (asinh x))
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/507f6d9e658dd231fb22b84029ffe3aad0eb62a3">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.common-lisp.net.
If you'd like to receive fewer emails, you can adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.common-lisp.net/cmucl/cmucl/commit/507f6d9e658dd231fb22b84029ffe3aad0eb62a3"}}</script>
</p>
</div>
</body>
</html>