Added tests for infinities.
authorArthur A. Gleckler <gnu@speechcode.com>
Thu, 2 Sep 2010 06:56:41 +0000 (23:56 -0700)
committerArthur A. Gleckler <gnu@speechcode.com>
Thu, 2 Sep 2010 06:56:41 +0000 (23:56 -0700)
tests/microcode/test-flonum-casts.scm

index 26ea178872470abd4240ae81896f415793b7eddd..151ae110c5c24b0680072ce2bc69727fe2d54a8e 100644 (file)
@@ -84,15 +84,15 @@ USA.
      -1.0
      #*1011111111110000000000000000000000000000000000000000000000000000)
 
-    ;; We should add a procedure that tests for floating-point
-    ;; infinity and use it here.
     (let ((positive-infinity
           (integer-to-double
            #*0111111111110000000000000000000000000000000000000000000000000000)))
+      (assert-false (flo:finite? positive-infinity))
       (assert-true (flo:positive? positive-infinity)))
     (let ((negative-infinity
           (integer-to-double
            #*1111111111110000000000000000000000000000000000000000000000000000)))
+      (assert-false (flo:finite? negative-infinity))
       (assert-true (flo:negative? negative-infinity)))
 
     (assert-true
@@ -138,14 +138,14 @@ USA.
     (test-single -1.0
                 #*10111111100000000000000000000000)
 
-    ;; We should add a procedure that tests for floating-point
-    ;; infinity and use it here.
     (let ((positive-infinity
           (integer-to-single #*01111111100000000000000000000000)))
-      (assert-true (flo:positive? positive-infinity)))
+      (assert-true (flo:positive? positive-infinity))
+      (assert-false (flo:finite? positive-infinity)))
     (let ((negative-infinity
           (integer-to-single #*11111111100000000000000000000000)))
-      (assert-true (flo:negative? negative-infinity)))
+      (assert-true (flo:negative? negative-infinity))
+      (assert-false (flo:finite? negative-infinity)))
 
     (assert-true
      (flo:nan?