[cmucl-commit] [git] CMU Common Lisp branch master updated. snapshot-2014-08-33-gdf548f6

Raymond Toy rtoy at common-lisp.net
Wed Aug 27 02:08:03 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  df548f6e69bc4fa0aec3825d10074135c9e4ac03 (commit)
      from  54dd52c6348b74051dd63be6abdd1952be7137af (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 df548f6e69bc4fa0aec3825d10074135c9e4ac03
Author: Raymond Toy <toy.raymond at gmail.com>
Date:   Tue Aug 26 19:07:54 2014 -0700

    Oops. Fix mistake in handling underflow for %exp.
    
     * src/lisp/e_exp.c:
       * Signal underflow instead of returning the arg.
     * tests/trig.lisp:
       * Add tests for %exp when exp underflows.

diff --git a/src/lisp/e_exp.c b/src/lisp/e_exp.c
index 034c590..93b638e 100644
--- a/src/lisp/e_exp.c
+++ b/src/lisp/e_exp.c
@@ -142,7 +142,10 @@ P5   =  4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
                 return fdlibm_setexception(x, FDLIBM_OVERFLOW);
             }
             
-	    if(x < u_threshold) return x; /* underflow */
+	    if(x < u_threshold) {
+		/* underflow */
+		return fdlibm_setexception(0.0, FDLIBM_UNDERFLOW);
+	    }
 	}
 
     /* argument reduction */
diff --git a/tests/trig.lisp b/tests/trig.lisp
index 724fabe..cfd7ea2 100644
--- a/tests/trig.lisp
+++ b/tests/trig.lisp
@@ -945,9 +945,18 @@
 		(kernel:%exp *snan*))
   (assert-equal ext:double-float-positive-infinity
 		(kernel:%exp ext:double-float-positive-infinity))
+  (assert-equal 0d0
+		(kernel:%exp -1000d0))
   (kernel::with-float-traps-masked (:overflow)
     (assert-equal ext:double-float-positive-infinity
-		  (kernel:%exp 710d0))))
+		  (kernel:%exp 710d0)))
+  (let ((modes (ext:get-floating-point-modes)))
+    (unwind-protect
+	 (progn
+	   (ext:set-floating-point-modes :traps '(:underflow))
+	   (assert-error 'floating-point-underflow
+			 (kernel:%exp -1000d0)))
+      (apply #'ext:set-floating-point-modes modes))))
 
 (define-test %log.exception
   (:tag :fdlibm)

-----------------------------------------------------------------------

Summary of changes:
 src/lisp/e_exp.c |    5 ++++-
 tests/trig.lisp  |   11 ++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMU Common Lisp


More information about the cmucl-commit mailing list