<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/a53d7ef42da5bf984ae51dc4d082accac2787ceb">a53d7ef4</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-23T14:14:13Z</i>
</div>
<pre class='commit-message'>Use setexception to raise the inexact exception.

o Update fdlibm.h and setexception.c to support the inexact execption.
o Use this in asinh.

Tests pass.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/0d53bc7f4a6713baf3b601497f26e5062d7a401d">0d53bc7f</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-23T14:24:49Z</i>
</div>
<pre class='commit-message'>Merge branch 'master' into rtoy-setexception-inexact</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/e655d01703c408ddf1ce1cd54b8fdb54f06ddcfc">e655d017</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-23T14:30:10Z</i>
</div>
<pre class='commit-message'>Use setexception to raise the inexact exception for asin.

o Add tests for this
o Use setexception for inexact in e_asin.c.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/8b36c06ea756bd081f26bfe5e957cacc195df25e">8b36c06e</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-23T15:48:58Z</i>
</div>
<pre class='commit-message'>Group the inexact exception test with the exceptions tests.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/b4c91767d6281cb4a6f976cee84cf17e876ccc6b">b4c91767</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-23T15:55:19Z</i>
</div>
<pre class='commit-message'>Use setexception to raise the inexact exception for exp.

o Add tests for this
o Use setexception for inexact in e_exp.c.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/e90e91d466888ae39d2b5e70841e1792dbb6dded">e90e91d4</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-23T19:43:17Z</i>
</div>
<pre class='commit-message'>Use setexception to raise the inexact exception for sinh.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/d448ca78228ea8b9173a4b42d24d16c8e9a4ef55">d448ca78</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-23T19:49:21Z</i>
</div>
<pre class='commit-message'>Use setexception to raise the inexact exception for cos.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/71bdff741b398e37acbd13623ebb3a8142217c0a">71bdff74</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-24T08:54:03Z</i>
</div>
<pre class='commit-message'>Use setexception to raise the inexact exception for sin.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/a31150c58c2727fcf802984b8306b849e6c5cba1">a31150c5</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-24T08:59:29Z</i>
</div>
<pre class='commit-message'>Use setexception to raise the inexact exception for tan.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/ae70cdd320e8e0cae0abae3f5f7d593d2f9d7018">ae70cdd3</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-24T09:06:54Z</i>
</div>
<pre class='commit-message'>Use setexception to raise the inexact exception for atan.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/89097cd0d602d233c8deddd443ba4baf0f147aef">89097cd0</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-24T09:15:27Z</i>
</div>
<pre class='commit-message'>Use setexception to raise the inexact exception for %expm1.</pre>
</li>
<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>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/b9e3a5113c1c08e5785fc36866a8e4553a96300e">b9e3a511</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-24T09:29:08Z</i>
</div>
<pre class='commit-message'>Use setexception to raise the inexact exception for tanh.

Note that original code didn't actually signal inexact probably
because the compiler constant-folded one - tiny to one.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/97bd0eaa99f355568b4d588863964b2cbaa61578">97bd0eaa</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-24T10:37:57Z</i>
</div>
<pre class='commit-message'>Add WITH-FLOAT-TRAPS-ENABLED to enable specific traps.

This works like WITH-FLOAT-TRAPS-MASKED, except that the specified
traps are enabled.

Use this in fdlibm to enable the inexact trap.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/5721ddd2c71849c61c25bad61c4d1877be45ccc7">5721ddd2</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-24T11:46:36Z</i>
</div>
<pre class='commit-message'>Simplify WITH-FLOAT-TRAPS-MASKED and WITH-FLOAT-TRAPS-ENABLED.

Merge the body of both macros into one since they only differ in how
the bits are merged with the actual mode bits.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/d2a8d5c7c555a2632934b0b4d1f071f59c445eaf">d2a8d5c7</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-24T22:25:13Z</i>
</div>
<pre class='commit-message'>ADD docstrings for WITH-FLOAT-TRAPS-MASKED and
WITH-FLOAT-TRAPS-ENABLED.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/519d513377255796b21230c2d51df6dcc51e3f67">519d5133</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-24T22:47:24Z</i>
</div>
<pre class='commit-message'>(setf floating-point-modes) wants (unsigned-byte 24)

When enabling traps, need to take just the low 24 bits of the arg
because (setf floating-point-modes) wants an (unsigned-byte 24)
argument.  The logorc2 makes the result negative when enabling traps.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/46e43aed4319f89f4ad6b68584774b348ea69be3">46e43aed</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-24T22:48:49Z</i>
</div>
<pre class='commit-message'>Use correct package (EXT) for WITH-FLOAT-TRAPS-MASKED.

Also replae WITH-INXACT-EXCEPTION-ENABLED with
WITH-FLOAT-TRAPS-ENABLED.

All tests still pass, as expected.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/38e8ce5c1084e1c55f90028829c7491a47909835">38e8ce5c</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-26T09:09:56Z</i>
</div>
<pre class='commit-message'>Fix bug on sparc and clean up.

On sparc and ppc (setf vm:floating-point-modes) takes an
(unsigned-byte 32) arg, so adjust the ldb byte appopriately. 

Clean up code by putting the docstring into the macro.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/6cc16b9bcc660a2899a6205b6202cedc590dd374">6cc16b9b</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-26T09:11:40Z</i>
</div>
<pre class='commit-message'>Regenerated du to float-traps.lisp changes.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/55b541e5fdac9794eae148597397bda915f96722">55b541e5</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-26T09:49:25Z</i>
</div>
<pre class='commit-message'>Add shell script to run the test suite.

This makes it quite a bit easier to run the test suite instead of
trying to remember exactly how to invoke it from the command line.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/62acaf64300552a1f74237f57ee0b0b9985f76ad">62acaf64</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-27T10:36:59Z</i>
</div>
<pre class='commit-message'>Merge branch 'master' into rtoy-setexception-inexact</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/90b9651bf60a59800f76a6e7fede76a4897dfae5">90b9651b</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-27T21:02:14Z</i>
</div>
<pre class='commit-message'>Clean up with-float-traps macro.

 * Add some comments.
 * Change x86 (setf floating-point-modes) to accept (unsigned-byte
   32).
 * Remove unneeded x86 conditionalization on the byte size.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/80d7ca4e8c9aae3154c38fe1746ee0b456fde8e6">80d7ca4e</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-28T10:26:27Z</i>
</div>
<pre class='commit-message'>Fix compiler warnings by removing unused vars.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/6a6908fbbfbd80918202d17557ec83891c7aaa38">6a6908fb</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-28T10:28:57Z</i>
</div>
<pre class='commit-message'>Remove trailing blank line.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/fc1c9daa7fa37857e699bdc8c291c2b7398c1e54">fc1c9daa</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-28T10:31:55Z</i>
</div>
<pre class='commit-message'>Replace with-inexact-exception-enabled with with-float-traps-enabled.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/5b83139e3c849b12519b539e71731f4b89de2acb">5b83139e</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-28T18:37:04Z</i>
</div>
<pre class='commit-message'>Use setexception to set inexact exception

Fix issue #12 by replacing the code with an explicit call to set the inexact exception when needed.</pre>
</li>
</ul>
<h4>20 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
<span class='new-file'>
+
bin/run-tests.sh
</span>
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
src/code/exports.lisp
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
src/code/float-trap.lisp
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
src/i18n/locale/cmucl.pot
</a>
</li>
<li class='file-stats'>
<a href='#diff-4'>
src/lisp/e_asin.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-5'>
src/lisp/e_cosh.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-6'>
src/lisp/e_exp.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-7'>
src/lisp/e_sinh.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-8'>
src/lisp/fdlibm.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-9'>
src/lisp/k_cos.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-10'>
src/lisp/k_sin.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-11'>
src/lisp/k_tan.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-12'>
src/lisp/s_asinh.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-13'>
src/lisp/s_atan.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-14'>
src/lisp/s_expm1.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-15'>
src/lisp/s_log1p.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-16'>
src/lisp/s_scalbn.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-17'>
src/lisp/s_tanh.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-18'>
src/lisp/setexception.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-19'>
tests/fdlibm.lisp
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-0'>
<strong>
bin/run-tests.sh
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- /dev/null
</span><span style="color: #000000;background-color: #ddffdd">+++ b/bin/run-tests.sh
</span><span style="color: #aaaaaa">@@ -0,0 +1,50 @@
</span><span style="color: #000000;background-color: #ddffdd">+#! /bin/bash
+
+# Run the testsuite.
+#
+# By default, all the tests are run, but if additional args are given,
+# then just those tests are run.
+
+usage() {
+    echo "run-tests.sh [?] [-l lisp] [tests]"
+    echo "    -l lisp      Lisp to use for the tests; defaults to lisp"
+    echo "    -?           This help message"
+    echo ""
+    echo "Run the test suite"
+    echo ""
+    echo "Any remaining args are the names of the tests to run."
+    echo "These are basically the file names (without extension)"
+    echo "in the tests/ directory."
+    echo ""
+    echo "This script expects to be run from the top level of the"
+    echo "cmucl source tree.  That is, is should be invoked as"
+    echo "bin/run-tests.sh"
+    exit 0;
+}
+
+LISP=lisp
+while getopts "h?l:" arg
+do
+    case $arg in
+      l) LISP=$OPTARG ;;
+      \?) usage ;;
+    esac
+done
+
+# Shift out the options
+shift $[$OPTIND - 1]
+
+if [ $# -eq 0 ]; then
+    # No args so run all the tests
+    $LISP -noinit -load tests/run-tests.lisp -eval '(cmucl-test-runner:run-all-tests)'
+else
+    # Run selected files.  Convert each file name to uppercase and append "-TESTS"
+    result=""
+    for f in $*
+    do
+       new=`echo $f | tr '[a-z]' '[A-Z]'`
+        result="$result "\"$new-TESTS\"
+    done
+    $LISP -noinit -load tests/run-tests.lisp -eval "(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test $result))"
+fi
+
</span></code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-1'>
<strong>
src/code/exports.lisp
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/code/exports.lisp
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/code/exports.lisp
</span><span style="color: #aaaaaa">@@ -1583,7 +1583,8 @@
</span>      "FLOAT-DENORMALIZED-P" "FLOAT-INFINITY-P"
           "FLOAT-NAN-P" "FLOAT-TRAPPING-NAN-P"
           "FLOAT-SIGNALING-NAN-P"
<span style="color: #000000;background-color: #ffdddd">-           "WITH-FLOAT-TRAPS-MASKED")
</span><span style="color: #000000;background-color: #ddffdd">+      "WITH-FLOAT-TRAPS-MASKED"
+          "WITH-FLOAT-TRAPS-ENABLED")
</span>   ;; More float extensions
   #+double-double
   (:export "LEAST-POSITIVE-NORMALIZED-DOUBLE-DOUBLE-FLOAT"
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-2'>
<strong>
src/code/float-trap.lisp
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/code/float-trap.lisp
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/code/float-trap.lisp
</span><span style="color: #aaaaaa">@@ -23,7 +23,8 @@
</span> )
 (in-package "EXTENSIONS")
 (export '(set-floating-point-modes get-floating-point-modes
<span style="color: #000000;background-color: #ffdddd">-          with-float-traps-masked))
</span><span style="color: #000000;background-color: #ddffdd">+     with-float-traps-masked
+         with-float-traps-enabled))
</span> (in-package "VM")
 
 (eval-when (compile load eval)
<span style="color: #aaaaaa">@@ -103,7 +104,7 @@
</span> 
       final-mode))
   (defun (setf floating-point-modes) (new-mode)
<span style="color: #000000;background-color: #ffdddd">-    (declare (type (unsigned-byte 24) new-mode))
</span><span style="color: #000000;background-color: #ddffdd">+    (declare (type (unsigned-byte 32) new-mode))
</span>     ;; Set the floating point modes for both X87 and SSE2.  This
     ;; include the rounding control bits.
     (let* ((rc (ldb float-rounding-mode new-mode))
<span style="color: #aaaaaa">@@ -116,8 +117,8 @@
</span>               ;; is ok and would be the correct setting if we
                    ;; ever support long-floats.
                    (ash 3 8))))
<span style="color: #000000;background-color: #ffdddd">-      (setf (vm::sse2-floating-point-modes) new-mode)
-      (setf (vm::x87-floating-point-modes) x87-modes))
</span><span style="color: #000000;background-color: #ddffdd">+      (setf (vm::sse2-floating-point-modes) (ldb (byte 24 0) new-mode))
+      (setf (vm::x87-floating-point-modes) (ldb (byte 24 0) x87-modes)))
</span>     new-mode)
   )
 
<span style="color: #aaaaaa">@@ -364,45 +365,66 @@
</span>            (error _"SIGFPE with no exceptions currently enabled? (si-code = ~D)"
                        code)))))))
 
<span style="color: #000000;background-color: #ffdddd">-;;; WITH-FLOAT-TRAPS-MASKED  --  Public
-;;;
-(defmacro with-float-traps-masked (traps &body body)
-  "Execute BODY with the floating point exceptions listed in TRAPS
</span><span style="color: #000000;background-color: #ddffdd">+(macrolet
+    ((with-float-traps (name logical-op docstring)
+       ;; Define macros to enable or disable floating-point
+       ;; exceptions.  Masked exceptions and enabled exceptions only
+       ;; differ whether we AND in the bits or OR them, respectively.
+       ;; Logical-op is the operation to use.
+       (let ((macro-name (symbolicate "WITH-FLOAT-TRAPS-" name)))
+        `(progn
+           (defmacro ,macro-name (traps &body body)
+             ,docstring
+             (let ((traps (dpb (float-trap-mask traps) float-traps-byte 0))
+                   (exceptions (dpb (float-trap-mask traps) float-sticky-bits 0))
+                   (trap-mask (dpb (lognot (float-trap-mask traps))
+                                   float-traps-byte #xffffffff))
+                   (exception-mask (dpb (lognot (vm::float-trap-mask traps))
+                                        float-sticky-bits #xffffffff))
+                   ;; On ppc if we are masking the invalid trap, we need to make
+                   ;; sure we wipe out the various individual sticky bits
+                   ;; representing the invalid operation.  Otherwise, if we
+                   ;; enable the invalid trap later, these sticky bits will cause
+                   ;; an exception.
+                   #+ppc
+                   (invalid-mask (if (member :invalid traps)
+                                     (dpb 0
+                                          (byte 1 31)
+                                          (dpb 0 vm::float-invalid-op-2-byte
+                                               (dpb 0 vm:float-invalid-op-1-byte #xffffffff)))
+                                     #xffffffff))
+                   (orig-modes (gensym)))
+               `(let ((,orig-modes (floating-point-modes)))
+                  (unwind-protect
+                       (progn
+                         (setf (floating-point-modes)
+                               (ldb (byte 32 0)
+                                    (,',logical-op ,orig-modes ,(logand trap-mask exception-mask))))
+                         ,@body)
+                    ;; Restore the original traps and exceptions.
+                    (setf (floating-point-modes)
+                          (logior (logand ,orig-modes ,(logior traps exceptions))
+                                  (logand (floating-point-modes)
+                                          ,(logand trap-mask exception-mask)
+                                          #+ppc
+                                          ,invalid-mask
+                                          #+mips ,(dpb 0 float-exceptions-byte #xffffffff))))))))))))
+
+  ;; WITH-FLOAT-TRAPS-MASKED  --  Public
+  (with-float-traps masked logand
+    _N"Execute BODY with the floating point exceptions listed in TRAPS
</span>   masked (disabled).  TRAPS should be a list of possible exceptions
   which includes :UNDERFLOW, :OVERFLOW, :INEXACT, :INVALID and
   :DIVIDE-BY-ZERO and on the X86 :DENORMALIZED-OPERAND. The respective
   accrued exceptions are cleared at the start of the body to support
<span style="color: #000000;background-color: #ffdddd">-  their testing within, and restored on exit."
-  (let ((traps (dpb (float-trap-mask traps) float-traps-byte 0))
-       (exceptions (dpb (float-trap-mask traps) float-sticky-bits 0))
-       (trap-mask (dpb (lognot (float-trap-mask traps))
-                       float-traps-byte #xffffffff))
-       (exception-mask (dpb (lognot (vm::float-trap-mask traps))
-                            float-sticky-bits #xffffffff))
-       ;; On ppc if we are masking the invalid trap, we need to make
-       ;; sure we wipe out the various individual sticky bits
-       ;; representing the invalid operation.  Otherwise, if we
-       ;; enable the invalid trap later, these sticky bits will cause
-       ;; an exception.
-       #+ppc
-       (invalid-mask (if (member :invalid traps)
-                         (dpb 0
-                              (byte 1 31)
-                              (dpb 0 vm::float-invalid-op-2-byte
-                                   (dpb 0 vm:float-invalid-op-1-byte #xffffffff)))
-                         #xffffffff))
-       (orig-modes (gensym)))
-    `(let ((,orig-modes (floating-point-modes)))
-      (unwind-protect
-          (progn
-            (setf (floating-point-modes)
-                  (logand ,orig-modes ,(logand trap-mask exception-mask)))
-            ,@body)
-       ;; Restore the original traps and exceptions.
-       (setf (floating-point-modes)
-             (logior (logand ,orig-modes ,(logior traps exceptions))
-                     (logand (floating-point-modes)
-                             ,(logand trap-mask exception-mask)
-                             #+ppc
-                             ,invalid-mask
-                             #+mips ,(dpb 0 float-exceptions-byte #xffffffff))))))))
</span><span style="color: #000000;background-color: #ddffdd">+  their testing within, and restored on exit.")
+
+  ;; WITH-FLOAT-TRAPS-ENABLED --  Public
+  (with-float-traps enabled logorc2
+    _N"Execute BODY with the floating point exceptions listed in TRAPS
+  enabled.  TRAPS should be a list of possible exceptions which
+  includes :UNDERFLOW, :OVERFLOW, :INEXACT, :INVALID and
+  :DIVIDE-BY-ZERO and on the X86 :DENORMALIZED-OPERAND. The respective
+  accrued exceptions are cleared at the start of the body to support
+  their testing within, and restored on exit."))
+
</span></code></pre>

<br>
</li>
<li id='diff-3'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-3'>
<strong>
src/i18n/locale/cmucl.pot
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/i18n/locale/cmucl.pot
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/i18n/locale/cmucl.pot
</span><span style="color: #aaaaaa">@@ -4797,6 +4797,16 @@ msgid ""
</span> "  their testing within, and restored on exit."
 msgstr ""
 
<span style="color: #000000;background-color: #ddffdd">+#: src/code/float-trap.lisp
+msgid ""
+"Execute BODY with the floating point exceptions listed in TRAPS\n"
+"  enabled.  TRAPS should be a list of possible exceptions which\n"
+"  includes :UNDERFLOW, :OVERFLOW, :INEXACT, :INVALID and\n"
+"  :DIVIDE-BY-ZERO and on the X86 :DENORMALIZED-OPERAND. The respective\n"
+"  accrued exceptions are cleared at the start of the body to support\n"
+"  their testing within, and restored on exit."
+msgstr ""
+
</span> #: src/code/float.lisp
 msgid "Return true if the float X is denormalized."
 msgstr ""
</code></pre>

<br>
</li>
<li id='diff-4'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-4'>
<strong>
src/lisp/e_asin.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/e_asin.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/e_asin.c
</span><span style="color: #aaaaaa">@@ -50,7 +50,6 @@ static const double
</span> static double 
 #endif
 one =  1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
<span style="color: #000000;background-color: #ffdddd">-huge =  1.000e+300,
</span> pio2_hi =  1.57079632679489655800e+00, /* 0x3FF921FB, 0x54442D18 */
 pio2_lo =  6.12323399573676603587e-17, /* 0x3C91A626, 0x33145C07 */
 pio4_hi =  7.85398163397448278999e-01, /* 0x3FE921FB, 0x54442D18 */
<span style="color: #aaaaaa">@@ -89,7 +88,12 @@ qS4 =  7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
</span>       return fdlibm_setexception(x, FDLIBM_INVALID);
        } else if (ix<0x3fe00000) {  /* |x|<0.5 */
            if(ix<0x3e400000) {              /* if |x| < 2**-27 */
<span style="color: #000000;background-color: #ffdddd">-                if(huge+x>one) return x;/* return x with inexact if x!=0*/
</span><span style="color: #000000;background-color: #ddffdd">+                /* return x inexact except 0 */
+                if (x != 0) {
+                    fdlibm_setexception(x, FDLIBM_INEXACT);
+                }
+
+                return x;
</span>       } else 
                t = x*x;
                p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
</code></pre>

<br>
</li>
<li id='diff-5'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-5'>
<strong>
src/lisp/e_cosh.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/e_cosh.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/e_cosh.c
</span><span style="color: #aaaaaa">@@ -35,7 +35,7 @@
</span> #include "fdlibm.h"
 
 #ifdef __STDC__
<span style="color: #000000;background-color: #ffdddd">-static const double one = 1.0, half=0.5, huge = 1.0e307;
</span><span style="color: #000000;background-color: #ddffdd">+static const double one = 1.0, half=0.5;
</span> #else
 static double one = 1.0, half=0.5, huge = 1.0e307;
 #endif
</code></pre>

<br>
</li>
<li id='diff-6'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-6'>
<strong>
src/lisp/e_exp.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/e_exp.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/e_exp.c
</span><span style="color: #aaaaaa">@@ -82,7 +82,6 @@ static double
</span> #endif
 one    = 1.0,
 halF[2]        = {0.5,-0.5,},
<span style="color: #000000;background-color: #ffdddd">-huge    = 1.0e+300,
</span> twom1000= 9.33263618503218878990e-302,     /* 2**-1000=0x01700000,0*/
 o_threshold=  7.09782712893383973096e+02,  /* 0x40862E42, 0xFEFA39EF */
 u_threshold= -7.45133219101941108420e+02,  /* 0xc0874910, 0xD52D3051 */
<span style="color: #aaaaaa">@@ -161,7 +160,12 @@ P5   =  4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
</span>       x  = hi - lo;
        } 
        else if(hx < 0x3e300000)  {  /* when |x|<2**-28 */
<span style="color: #000000;background-color: #ffdddd">-            if(huge+x>one) return one+x;/* trigger inexact */
</span><span style="color: #000000;background-color: #ddffdd">+            /* return x inexact except 0 */
+            if (x != 0) {
+                fdlibm_setexception(x, FDLIBM_INEXACT);
+            }
+
+            return one + x;
</span>   }
        else k = 0;
 
</code></pre>

<br>
</li>
<li id='diff-7'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-7'>
<strong>
src/lisp/e_sinh.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/e_sinh.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/e_sinh.c
</span><span style="color: #aaaaaa">@@ -32,7 +32,7 @@
</span> #include "fdlibm.h"
 
 #ifdef __STDC__
<span style="color: #000000;background-color: #ffdddd">-static const double one = 1.0, shuge = 1.0e307;
</span><span style="color: #000000;background-color: #ddffdd">+static const double one = 1.0;
</span> #else
 static double one = 1.0, shuge = 1.0e307;
 #endif
<span style="color: #aaaaaa">@@ -67,8 +67,14 @@ static double one = 1.0, shuge = 1.0e307;
</span>   if (jx<0) h = -h;
     /* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */
        if (ix < 0x40360000) {               /* |x|<22 */
<span style="color: #000000;background-color: #ffdddd">-            if (ix<0x3e300000)               /* |x|<2**-28 */
-               if(shuge+x>one) return x;/* sinh(tiny) = tiny with inexact */
</span><span style="color: #000000;background-color: #ddffdd">+       if (ix<0x3e300000) {             /* |x|<2**-28 */
+               /* sinh(tiny) = tiny with inexact */
+               if (x != 0) {
+                   fdlibm_setexception(x, FDLIBM_INEXACT);
+               }
+
+               return x;               
+           }
</span>       t = fdlibm_expm1(fabs(x));
            if(ix<0x3ff00000) return h*(2.0*t-t*t/(t+one));
            return h*(t+t/(t+one));
</code></pre>

<br>
</li>
<li id='diff-8'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-8'>
<strong>
src/lisp/fdlibm.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/fdlibm.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/fdlibm.h
</span><span style="color: #aaaaaa">@@ -61,7 +61,8 @@ enum FDLIBM_EXCEPTION {
</span>   FDLIBM_DIVIDE_BY_ZERO,
   FDLIBM_UNDERFLOW,
   FDLIBM_OVERFLOW,
<span style="color: #000000;background-color: #ffdddd">-  FDLIBM_INVALID
</span><span style="color: #000000;background-color: #ddffdd">+  FDLIBM_INVALID,
+  FDLIBM_INEXACT
</span> };
 
 extern double fdlibm_setexception(double x, enum FDLIBM_EXCEPTION);
</code></pre>

<br>
</li>
<li id='diff-9'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-9'>
<strong>
src/lisp/k_cos.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/k_cos.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/k_cos.c
</span><span style="color: #aaaaaa">@@ -75,7 +75,12 @@ C6  = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */
</span>         ux.d = x;
        ix = ux.i[HIWORD]&0x7fffffff;       /* ix = |x|'s high word*/
        if(ix<0x3e400000) {                  /* if x < 2**27 */
<span style="color: #000000;background-color: #ffdddd">-            if(((int)x)==0) return one;         /* generate inexact */
</span><span style="color: #000000;background-color: #ddffdd">+            /* return 1 with inexact unless x == 0 */
+            if (x != 0) {
+                fdlibm_setexception(x, FDLIBM_INEXACT);
+            }
+
+            return one;
</span>   }
        z  = x*x;
        r  = z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*C6)))));
</code></pre>

<br>
</li>
<li id='diff-10'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-10'>
<strong>
src/lisp/k_sin.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/k_sin.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/k_sin.c
</span><span style="color: #aaaaaa">@@ -67,8 +67,14 @@ S6  =  1.58969099521155010221e-10; /* 0x3DE5D93A, 0x5ACFD57C */
</span> 
         ux.d = x;
        ix = ux.i[HIWORD]&0x7fffffff;       /* high word of x */
<span style="color: #000000;background-color: #ffdddd">-        if(ix<0x3e400000)                    /* |x| < 2**-27 */
-          {if((int)x==0) return x;}            /* generate inexact */
</span><span style="color: #000000;background-color: #ddffdd">+   if(ix<0x3e400000) {                  /* |x| < 2**-27 */
+            /* return x inexact except 0 */
+            if (x != 0) {
+                fdlibm_setexception(x, FDLIBM_INEXACT);
+            }
+
+            return x;
+        }
</span>   z       =  x*x;
        v       =  z*x;
        r       =  S2+z*(S3+z*(S4+z*(S5+z*S6)));
</code></pre>

<br>
</li>
<li id='diff-11'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-11'>
<strong>
src/lisp/k_tan.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/k_tan.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/k_tan.c
</span><span style="color: #aaaaaa">@@ -78,31 +78,34 @@ __kernel_tan(double x, double y, int iy) {
</span>   hx = ux.i[HIWORD];              /* high word of x */
        ix = hx & 0x7fffffff;                       /* high word of |x| */
        if (ix < 0x3e300000) {                       /* x < 2**-28 */
<span style="color: #000000;background-color: #ffdddd">-                if ((int) x == 0) {             /* generate inexact */
-                       if (((ix | ux.i[LOWORD]) | (iy + 1)) == 0)
-                               return one / fabs(x);
-                       else {
-                               if (iy == 1)
-                                       return x;
-                               else {  /* compute -1 / (x+y) carefully */
-                                       double a, t;
</span><span style="color: #000000;background-color: #ddffdd">+            /* return x inexact except 0 */
+            if (x != 0) {
+                fdlibm_setexception(x, FDLIBM_INEXACT);
+            }
</span> 
<span style="color: #000000;background-color: #ffdddd">-                                        z = w = x + y;
-                                        uz.d = z;
-                                       uz.i[LOWORD] = 0;
-                                        z = ux.d;
</span><span style="color: #000000;background-color: #ddffdd">+       if (((ix | ux.i[LOWORD]) | (iy + 1)) == 0)
+               return one / fabs(x);
+           else {
+               if (iy == 1)
+                   return x;
+               else {  /* compute -1 / (x+y) carefully */
+                   double a, t;
+
+                   z = w = x + y;
+                   uz.d = z;
+                   uz.i[LOWORD] = 0;
+                   z = ux.d;
</span>                                         
<span style="color: #000000;background-color: #ffdddd">-                                        v = y - (z - x);
-                                       t = a = -one / w;
-                                        uz.d = t;
-                                        uz.i[LOWORD] = 0;
-                                        t = uz.d;
</span><span style="color: #000000;background-color: #ddffdd">+               v = y - (z - x);
+                   t = a = -one / w;
+                   uz.d = t;
+                   uz.i[LOWORD] = 0;
+                   t = uz.d;
</span>                                         
<span style="color: #000000;background-color: #ffdddd">-                                        s = one + t * z;
-                                       return t + a * (s + t * v);
-                               }
-                       }
</span><span style="color: #000000;background-color: #ddffdd">+               s = one + t * z;
+                   return t + a * (s + t * v);
</span>           }
<span style="color: #000000;background-color: #ddffdd">+            }
</span>   }
        if (ix >= 0x3FE59428) {      /* |x| >= 0.6744 */
                if (hx < 0) {
</code></pre>

<br>
</li>
<li id='diff-12'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-12'>
<strong>
src/lisp/s_asinh.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/s_asinh.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/s_asinh.c
</span><span style="color: #aaaaaa">@@ -32,8 +32,7 @@ static const double
</span> static double 
 #endif
 one =  1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
<span style="color: #000000;background-color: #ffdddd">-ln2 =  6.93147180559945286227e-01, /* 0x3FE62E42, 0xFEFA39EF */
-huge=  1.00000000000000000000e+300; 
</span><span style="color: #000000;background-color: #ddffdd">+ln2 =  6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */
</span> 
 #ifdef __STDC__
        double fdlibm_asinh(double x)
<span style="color: #aaaaaa">@@ -59,7 +58,12 @@ huge=  1.00000000000000000000e+300;
</span>         }
         
        if(ix< 0x3e300000) { /* |x|<2**-28 */
<span style="color: #000000;background-color: #ffdddd">-            if(huge+x>one) return x; /* return x inexact except 0 */
</span><span style="color: #000000;background-color: #ddffdd">+            /* return x inexact except 0 */
+            if (x != 0) {
+                fdlibm_setexception(x, FDLIBM_INEXACT);
+            }
+
+            return x;
</span>   } 
        if(ix>0x41b00000) {  /* |x| > 2**28 */
            w = __ieee754_log(fabs(x))+ln2;
</code></pre>

<br>
</li>
<li id='diff-13'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-13'>
<strong>
src/lisp/s_atan.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/s_atan.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/s_atan.c
</span><span style="color: #aaaaaa">@@ -79,8 +79,7 @@ static double aT[] = {
</span> #else
        static double 
 #endif
<span style="color: #000000;background-color: #ffdddd">-one   = 1.0,
-huge   = 1.0e300;
</span><span style="color: #000000;background-color: #ddffdd">+one   = 1.0;
</span> 
 #ifdef __STDC__
        double fdlibm_atan(double x)
<span style="color: #aaaaaa">@@ -104,7 +103,12 @@ huge   = 1.0e300;
</span>       else     return -atanhi[3]-atanlo[3];
        } if (ix < 0x3fdc0000) {     /* |x| < 0.4375 */
            if (ix < 0x3e200000) {   /* |x| < 2^-29 */
<span style="color: #000000;background-color: #ffdddd">-                if(huge+x>one) return x;     /* raise inexact */
</span><span style="color: #000000;background-color: #ddffdd">+           /* return x inexact except 0 */
+               if (x != 0) {
+                   fdlibm_setexception(x, FDLIBM_INEXACT);
+               }
+
+               return x;
</span>       }
            id = -1;
        } else {
</code></pre>

<br>
</li>
<li id='diff-14'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-14'>
<strong>
src/lisp/s_expm1.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/s_expm1.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/s_expm1.c
</span><span style="color: #aaaaaa">@@ -160,8 +160,8 @@ Q5  =  -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */
</span>                 
            }
            if(xsb!=0) { /* x < -56*ln2, return -1.0 with inexact */
<span style="color: #000000;background-color: #ffdddd">-                if(x+tiny<0.0)               /* raise inexact */
-               return tiny-one;        /* return -1 */
</span><span style="color: #000000;background-color: #ddffdd">+                fdlibm_setexception(x, FDLIBM_INEXACT);
+               return tiny - one;
</span>       }
        }
 
</code></pre>

<br>
</li>
<li id='diff-15'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-15'>
<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">@@ -85,7 +85,6 @@ static double
</span> #endif
 ln2_hi  =  6.93147180369123816490e-01, /* 3fe62e42 fee00000 */
 ln2_lo  =  1.90821492927058770002e-10, /* 3dea39ef 35793c76 */
<span style="color: #000000;background-color: #ffdddd">-two54   =  1.80143985094819840000e+16,  /* 43500000 00000000 */
</span> Lp1 = 6.666666666666735130e-01,  /* 3FE55555 55555593 */
 Lp2 = 3.999999999940941908e-01,  /* 3FD99999 9997FA04 */
 Lp3 = 2.857142874366239149e-01,  /* 3FD24924 94229359 */
<span style="color: #aaaaaa">@@ -123,9 +122,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-16'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-16'>
<strong>
src/lisp/s_scalbn.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/s_scalbn.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/s_scalbn.c
</span><span style="color: #aaaaaa">@@ -26,9 +26,7 @@ static const double
</span> static double
 #endif
 two54   =  1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
<span style="color: #000000;background-color: #ffdddd">-twom54  =  5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
-huge   = 1.0e+300,
-tiny   = 1.0e-300;
</span><span style="color: #000000;background-color: #ddffdd">+twom54  =  5.55111512312578270212e-17; /* 0x3C900000, 0x00000000 */
</span> 
 #ifdef __STDC__
        double fdlibm_scalbn (double x, int n)
</code></pre>

<br>
</li>
<li id='diff-17'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-17'>
<strong>
src/lisp/s_tanh.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/s_tanh.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/s_tanh.c
</span><span style="color: #aaaaaa">@@ -78,7 +78,9 @@ static double one=1.0, two=2.0, tiny = 1.0e-300;
</span>       }
     /* |x| > 22, return +-1 */
        } else {
<span style="color: #000000;background-color: #ffdddd">-            z = one - tiny;             /* raised inexact flag */
</span><span style="color: #000000;background-color: #ddffdd">+       /* Always raise inexact flag */
+           fdlibm_setexception(x, FDLIBM_INEXACT);
+           z = one - tiny;
</span>   }
        return (jx>=0)? z: -z;
 }
</code></pre>

<br>
</li>
<li id='diff-18'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-18'>
<strong>
src/lisp/setexception.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/setexception.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/setexception.c
</span><span style="color: #aaaaaa">@@ -88,6 +88,10 @@ fdlibm_setexception(double x, enum FDLIBM_EXCEPTION type)
</span>           
           break;
       }
<span style="color: #000000;background-color: #ddffdd">+    case FDLIBM_INEXACT:
+        feraiseexcept(FE_INEXACT);
+        ret = x;
+        break;
</span>     default:
       /* Shouldn't happen! */
       ret = 0.0;
</code></pre>

<br>
</li>
<li id='diff-19'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb#diff-19'>
<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">@@ -6,7 +6,7 @@
</span> (in-package "FDLIBM-TESTS")
 
 (defparameter *qnan*
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:invalid)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:invalid)
</span>     (* 0 ext:double-float-positive-infinity))
   "Some randon quiet MaN value")
 
<span style="color: #aaaaaa">@@ -14,15 +14,6 @@
</span>   (kernel:make-double-float #x7ff00000 1)
   "A randon signaling MaN value")
 
<span style="color: #000000;background-color: #ffdddd">-(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">@@ -34,7 +25,7 @@
</span>   (assert-true (ext:float-nan-p (kernel:%cosh *qnan*)))
   
   ;; Same, but with overflow's masked
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:overflow)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:overflow)
</span>     (assert-equal ext:double-float-positive-infinity
                  (kernel:%cosh 1000d0))
     (assert-equal ext:double-float-positive-infinity
<span style="color: #aaaaaa">@@ -44,7 +35,7 @@
</span>     (assert-equal ext:double-float-positive-infinity
                  (kernel:%cosh ext:double-float-negative-infinity)))
   ;; Test NaN
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:invalid)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:invalid)
</span>     (assert-true (ext:float-nan-p (kernel:%cosh *snan*)))))
 
 (define-test %sinh.exceptions
<span style="color: #aaaaaa">@@ -57,7 +48,7 @@
</span>           (kernel:%sinh *snan*))
   (assert-true (ext:float-nan-p (kernel:%sinh *qnan*)))
   ;; Same, but with overflow's masked
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:overflow)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:overflow)
</span>     (assert-equal ext:double-float-positive-infinity
                  (kernel:%sinh 1000d0))
     (assert-equal ext:double-float-negative-infinity
<span style="color: #aaaaaa">@@ -67,17 +58,35 @@
</span>     (assert-equal ext:double-float-negative-infinity
                  (kernel:%sinh ext:double-float-negative-infinity)))
   ;; Test NaN
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:invalid)
-    (assert-true (ext:float-nan-p (kernel:%sinh *qnan*)))))
-
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:invalid)
+    (assert-true (ext:float-nan-p (kernel:%sinh *qnan*))))
+  ;; sinh(x) = x for |x| < 2^-28.  Should signal inexact unless x = 0.
+  (let ((x (scale-float 1d0 -29))
+       (x0 0d0))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must not throw an inexact exception because the result
+       ;; is exact when the arg is 0.
+       (assert-eql 0d0 (kernel:%sinh x0)))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must throw an inexact exception for non-zero x even
+       ;; though the result is exactly x.
+       (assert-error 'floating-point-inexact
+                     (kernel:%sinh x)))))
</span> 
 (define-test %tanh.exceptions
   (:tag :fdlibm)
   (assert-true (ext:float-nan-p (kernel:%tanh *qnan*)))
   (assert-error 'floating-point-invalid-operation
                (kernel:%tanh *snan*))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:invalid)
-    (assert-true (ext:float-nan-p (kernel:%tanh *snan*)))))
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:invalid)
+    (assert-true (ext:float-nan-p (kernel:%tanh *snan*))))
+  ;; tanh(x) = +/- 1 for |x| > 22, raising inexact, always.
+  (let ((x 22.1d0))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must throw an inexact exception for non-zero x even
+       ;; though the result is exactly x.
+       (assert-error 'floating-point-inexact
+                     (kernel:%tanh x)))))
</span> 
 (define-test %acosh.exceptions
   (:tag :fdlibm)
<span style="color: #aaaaaa">@@ -85,10 +94,10 @@
</span>           (kernel:%acosh ext:double-float-positive-infinity))
   (assert-error 'floating-point-invalid-operation
                (kernel:%acosh 0d0))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:overflow)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:overflow)
</span>     (assert-equal ext:double-float-positive-infinity
                  (kernel:%acosh ext:double-float-positive-infinity)))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:invalid)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:invalid)
</span>     (assert-true (ext:float-nan-p (kernel:%acosh 0d0)))))
 
 (define-test %asinh.exceptions
<span style="color: #aaaaaa">@@ -100,13 +109,24 @@
</span>   (assert-error 'floating-point-overflow
                (kernel:%asinh ext:double-float-negative-infinity))
   (assert-true (ext:float-nan-p (kernel:%asinh *qnan*)))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:overflow)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:overflow)
</span>     (assert-equal ext:double-float-positive-infinity
                  (kernel:%asinh ext:double-float-positive-infinity))
     (assert-error ext:double-float-negative-infinity
                  (kernel:%asinh ext:double-float-negative-infinity)))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:invalid)
-    (assert-true (ext:float-nan-p (kernel:%asinh *snan*)))))
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:invalid)
+    (assert-true (ext:float-nan-p (kernel:%asinh *snan*))))
+  (let ((x (scale-float 1d0 -29))
+       (x0 0d0))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must not throw an inexact exception because the result
+       ;; is exact when the arg is 0.
+       (assert-eql 0d0 (asinh x0)))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; 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> 
 (define-test %atanh.exceptions
   (:tag :fdlibm)
<span style="color: #aaaaaa">@@ -118,10 +138,10 @@
</span>           (kernel:%atanh 1d0))
   (assert-error 'division-by-zero
                (kernel:%atanh -1d0))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:invalid)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:invalid)
</span>     (assert-true (ext:float-nan-p (kernel:%atanh 2d0)))
     (assert-true (ext:float-nan-p (kernel:%atanh -2d0))))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:divide-by-zero)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:divide-by-zero)
</span>     (assert-equal ext:double-float-positive-infinity
                  (kernel:%atanh 1d0))
     (assert-equal ext:double-float-negative-infinity
<span style="color: #aaaaaa">@@ -136,12 +156,17 @@
</span>   (assert-error 'floating-point-invalid-operation
                (kernel:%expm1 *snan*))
   (assert-true (ext:float-nan-p (kernel:%expm1 *qnan*)))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:overflow)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:overflow)
</span>     (assert-equal ext:double-float-positive-infinity
                 (kernel:%expm1 709.8d0))
     )
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:invalid)
-    (assert-true (ext::float-nan-p (kernel:%expm1 *snan*)))))
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:invalid)
+    (assert-true (ext::float-nan-p (kernel:%expm1 *snan*))))
+  ;; expm1(x) = -1 for x < -56*log(2), signaling inexact
+  (let ((x (* -57 (log 2d0))))
+    (ext:with-float-traps-enabled (:inexact)
+       (assert-error 'floating-point-inexact
+                     (kernel:%expm1 x)))))
</span> 
 (define-test %log1p.exceptions
   (:tag :fdlibm)
<span style="color: #aaaaaa">@@ -150,11 +175,23 @@
</span>   (assert-error 'floating-point-overflow
                (kernel:%log1p -1d0))
   (assert-true (ext:float-nan-p (kernel:%log1p *qnan*)))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:overflow)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:overflow)
</span>     (assert-equal ext:double-float-negative-infinity
                  (kernel:%log1p -1d0)))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:invalid)
-    (assert-true (ext:float-nan-p (kernel:%log1p *snan*)))))
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:invalid)
+    (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))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must not throw an inexact exception because the result
+       ;; is exact when the arg is 0.
+       (assert-eql 0d0 (kernel:%log1p x0)))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; 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)
<span style="color: #aaaaaa">@@ -167,7 +204,7 @@
</span>           (kernel:%exp ext:double-float-positive-infinity))
   (assert-equal 0d0
                (kernel:%exp -1000d0))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:overflow)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:overflow)
</span>     (assert-equal ext:double-float-positive-infinity
                  (kernel:%exp 710d0)))
   (let ((modes (ext:get-floating-point-modes)))
<span style="color: #aaaaaa">@@ -176,7 +213,19 @@
</span>      (ext:set-floating-point-modes :traps '(:underflow))
           (assert-error 'floating-point-underflow
                         (kernel:%exp -1000d0)))
<span style="color: #000000;background-color: #ffdddd">-      (apply #'ext:set-floating-point-modes modes))))
</span><span style="color: #000000;background-color: #ddffdd">+      (apply #'ext:set-floating-point-modes modes)))
+  (let ((x (scale-float 1d0 -29))
+       (x0 0d0))
+    ;; exp(x) = x, |x| < 2^-28, with inexact exception unlees x = 0
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must not throw an inexact exception because the result
+       ;; is exact when the arg is 0.
+       (assert-eql 1d0 (kernel:%exp x0)))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must throw an inexact exception for non-zero x even
+       ;; though the result is exactly x.
+       (assert-error 'floating-point-inexact
+                     (kernel:%exp x)))))
</span> 
 (define-test %log.exception
   (:tag :fdlibm)
<span style="color: #aaaaaa">@@ -189,12 +238,12 @@
</span>   (assert-error 'floating-point-invalid-operation
                (kernel:%log *snan*))
   (assert-true (ext:float-nan-p (kernel:%log *qnan*)))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:divide-by-zero)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:divide-by-zero)
</span>     (assert-equal ext:double-float-negative-infinity
                  (kernel:%log 0d0))
     (assert-equal ext:double-float-negative-infinity
                  (kernel:%log -0d0)))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:invalid)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:invalid)
</span>     (assert-true (ext:float-nan-p (kernel:%log -1d0)))
     (assert-true (ext:float-nan-p (kernel:%log *snan*)))))
 
<span style="color: #aaaaaa">@@ -204,7 +253,7 @@
</span>           (kernel:%acos 2d0))
   (assert-error 'floating-point-invalid-operation
                (kernel:%acos -2d0))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:invalid)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:invalid)
</span>     (assert-true (ext:float-nan-p (kernel:%acos 2d0)))
     (assert-true (ext:float-nan-p (kernel:%acos -2d0)))))
 
<span style="color: #aaaaaa">@@ -214,7 +263,7 @@
</span>           (kernel:%asin 2d0))
   (assert-error 'floating-point-invalid-operation
                (kernel:%asin -2d0))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:invalid)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:invalid)
</span>     (assert-true (ext:float-nan-p (kernel:%asin 2d0)))
     (assert-true (ext:float-nan-p (kernel:%asin -2d0)))))
 
<span style="color: #aaaaaa">@@ -223,8 +272,20 @@
</span>   (assert-error 'floating-point-invalid-operation
                (kernel:%atan *snan*))
   (assert-true (ext:float-nan-p (kernel:%atan *qnan*)))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:invalid)
-    (assert-true (ext:float-nan-p (kernel:%atan *snan*)))))
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:invalid)
+    (assert-true (ext:float-nan-p (kernel:%atan *snan*))))
+  ;; atan(x) = x for |x| < 2^-29, signaling inexact.
+  (let ((x (scale-float 1d0 -30))
+       (x0 0d0))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must not throw an inexact exception because the result
+       ;; is exact when the arg is 0.
+       (assert-eql 0d0 (kernel:%atan x0)))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must throw an inexact exception for non-zero x even
+       ;; though the result is exactly x.
+       (assert-error 'floating-point-inexact
+                     (kernel:%atan x)))))
</span> 
 (define-test %log10.exceptions
   (:tag :fdlibm)
<span style="color: #aaaaaa">@@ -239,12 +300,12 @@
</span>   (assert-true (ext:float-nan-p (kernel:%log10 *qnan*)))
   (assert-equal ext:double-float-positive-infinity
                (kernel:%log10 ext:double-float-positive-infinity))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:divide-by-zero)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:divide-by-zero)
</span>     (assert-equal ext:double-float-negative-infinity
                  (kernel:%log10 0d0))
     (assert-equal ext:double-float-negative-infinity
                  (kernel:%log10 -0d0)))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:invalid)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:invalid)
</span>     (assert-true (ext:float-nan-p (kernel:%log10 -1d0)))))
 
 (define-test %scalbn.exceptions
<span style="color: #aaaaaa">@@ -268,7 +329,7 @@
</span>           (kernel:%scalbn most-positive-double-float 2))
   (assert-error 'floating-point-overflow
                (kernel:%scalbn most-negative-double-float 2))
<span style="color: #000000;background-color: #ffdddd">-  (kernel::with-float-traps-masked (:overflow)
</span><span style="color: #000000;background-color: #ddffdd">+  (ext:with-float-traps-masked (:overflow)
</span>     (assert-equal ext:double-float-positive-infinity
                  (kernel:%scalbn ext:double-float-positive-infinity 1))
     (assert-equal ext:double-float-positive-infinity
<span style="color: #aaaaaa">@@ -298,16 +359,7 @@
</span>   (x0 0d0))
     ;; asinh(x) = x for x < 2^-28
     (assert-eql x (asinh x))
<span style="color: #000000;background-color: #ffdddd">-    (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><span style="color: #000000;background-color: #ddffdd">+    (assert-eql (- x) (asinh (- x))))
</span>   (let ((x (scale-float 1d0 -28)))
     ;; Case 2 > |x| >= 2^-28
     (assert-eql 3.725290298461914d-9 (asinh x))
<span style="color: #aaaaaa">@@ -556,4 +608,74 @@
</span>   (assert-eql -1d0 (tanh -100d0))
   ;; tanh(1d300), no overflow
   (assert-eql 1d0 (tanh most-positive-double-float))
<span style="color: #000000;background-color: #ffdddd">-  (assert-eql -1d0 (tanh (- most-positive-double-float))))
</span>\ No newline at end of file
<span style="color: #000000;background-color: #ddffdd">+  (assert-eql -1d0 (tanh (- most-positive-double-float))))
+
+(define-test %asin-basic-tests
+    (:tag :fdlibm)
+  (let ((x (scale-float 1d0 -28))
+       (x0 0d0))
+    ;; asin(x) = x for |x| < 2^-27, with inexact exception if x is not 0.
+    (assert-eql x (kernel:%asin x))
+    (assert-eql (- x) (kernel:%asin (- x)))))
+
+(define-test %asin-exception
+    (:tag :fdlibm)
+  (let ((x (scale-float 1d0 -28))
+       (x0 0d0))
+    ;; asin(x) = x for |x| < 2^-27, with inexact exception if x is not 0.
+    (assert-eql x (kernel:%asin x))
+    (assert-eql (- x) (kernel:%asin (- x)))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must not throw an inexact exception because the result
+       ;; is exact when the arg is 0.
+       (assert-eql 0d0 (kernel:%asin x0)))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must throw an inexact exception for non-zero x even
+       ;; though the result is exactly x.
+       (assert-error 'floating-point-inexact
+                     (kernel:%asin x)))))
+
+(define-test %cos.exceptions
+    (:tag :fdlibm)
+  ;; cos(x) = 1 for |x| < 2^-27.  Signal inexact unless x = 0
+  (let ((x (scale-float 1d0 -28))
+       (x0 0d0))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must not throw an inexact exception because the result
+       ;; is exact when the arg is 0.
+       (assert-eql 1d0 (kernel:%cos x0)))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must throw an inexact exception for non-zero x even
+       ;; though the result is exactly x.
+       (assert-error 'floating-point-inexact
+                     (kernel:%cos x)))))
+
+(define-test %sin.exceptions
+    (:tag :fdlibm)
+  ;; sin(x) = x for |x| < 2^-27.  Signal inexact unless x = 0
+  (let ((x (scale-float 1d0 -28))
+       (x0 0d0))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must not throw an inexact exception because the result
+       ;; is exact when the arg is 0.
+       (assert-eql 0d0 (kernel:%sin x0)))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must throw an inexact exception for non-zero x even
+       ;; though the result is exactly x.
+       (assert-error 'floating-point-inexact
+                     (kernel:%sin x)))))
+
+(define-test %tan.exceptions
+    (:tag :fdlibm)
+  ;; tan(x) = x for |x| < 2^-28.  Signal inexact unless x = 0
+  (let ((x (scale-float 1d0 -29))
+       (x0 0d0))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must not throw an inexact exception because the result
+       ;; is exact when the arg is 0.
+       (assert-eql 0d0 (kernel:%tan x0)))
+    (ext:with-float-traps-enabled (:inexact)
+       ;; This must throw an inexact exception for non-zero x even
+       ;; though the result is exactly x.
+       (assert-error 'floating-point-inexact
+                     (kernel:%tan x)))))
</span></code></pre>

<br>
</li>

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

<br>
<a href="https://gitlab.common-lisp.net/cmucl/cmucl/compare/0fc0061b5302f516f051a599685b8be575535643...5b83139e3c849b12519b539e71731f4b89de2acb">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.

</p>
</div>
</body>
</html>