<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 rtoy-setexception-inexact 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/91ff36070092df5d879081a435bd7d22587c8717">91ff3607</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-24T09:23:06Z</i>
</div>
<pre class='commit-message'>Use setexception to raise the inexact exception for %log1p.</pre>
</li>
</ul>
<h4>2 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
src/lisp/s_log1p.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
tests/fdlibm.lisp
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/commit/91ff36070092df5d879081a435bd7d22587c8717#diff-0'>
<strong>
src/lisp/s_log1p.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/s_log1p.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/s_log1p.c
</span><span style="color: #aaaaaa">@@ -123,9 +123,14 @@ static double zero = 0.0;
</span>                 }
            }
            if(ax<0x3e200000) {                      /* |x| < 2**-29 */
<span style="color: #000000;background-color: #ffdddd">-                if(two54+x>zero                      /* raise inexact */
-                   &&ax<0x3c900000)                 /* |x| < 2**-54 */
</span><span style="color: #000000;background-color: #ddffdd">+           if (ax < 0x3c900000) {  /* |x| < 2**-54 */
+                   /* return x inexact except 0 */
+                   if (x != 0) {
+                       fdlibm_setexception(x, FDLIBM_INEXACT);
+                   }
+
</span>               return x;
<span style="color: #000000;background-color: #ddffdd">+                }
</span>           else
                    return x - x*x*0.5;
            }
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/commit/91ff36070092df5d879081a435bd7d22587c8717#diff-1'>
<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">@@ -181,7 +181,19 @@
</span>     (assert-equal ext:double-float-negative-infinity
                  (kernel:%log1p -1d0)))
   (kernel::with-float-traps-masked (:invalid)
<span style="color: #000000;background-color: #ffdddd">-    (assert-true (ext:float-nan-p (kernel:%log1p *snan*)))))
</span><span style="color: #000000;background-color: #ddffdd">+    (assert-true (ext:float-nan-p (kernel:%log1p *snan*))))
+  ;; log1p(x) = x for |x| < 2^-54, signaling inexact except for x = 0.
+  (let ((x (scale-float 1d0 -55))
+       (x0 0d0))
+    (with-inexact-exception-enabled
+       ;; This must not throw an inexact exception because the result
+       ;; is exact when the arg is 0.
+       (assert-eql 0d0 (kernel:%log1p 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
+                     (kernel:%log1p x)))))
</span> 
 (define-test %exp.exceptions
   (:tag :fdlibm)
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/91ff36070092df5d879081a435bd7d22587c8717">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/91ff36070092df5d879081a435bd7d22587c8717"}}</script>
</p>
</div>
</body>
</html>