Added trivial tests for conversion to floating-point infinities by
authorArthur A. Gleckler <gnu@speechcode.com>
Thu, 2 Sep 2010 05:43:46 +0000 (22:43 -0700)
committerArthur A. Gleckler <gnu@speechcode.com>
Thu, 2 Sep 2010 05:43:46 +0000 (22:43 -0700)
`cast-integer-to-ieee754-single' and `cast-integer-to-ieee754-double'.

tests/microcode/test-flonum-casts.scm

index 0d933e6659b149029fe799b66103196ffeedd973..864522c36f6a3ab6e5742861b81f5e1d45cfbfda 100644 (file)
@@ -84,6 +84,17 @@ USA.
      -1.0
      #*1011111111110000000000000000000000000000000000000000000000000000)
 
+    ;; We should a procedure that tests for floating-point infinity
+    ;; and use it here.
+    (let ((positive-infinity
+          (integer-to-double
+           #*0111111111110000000000000000000000000000000000000000000000000000)))
+      (assert-true (flo:positive? positive-infinity)))
+    (let ((negative-infinity
+          (integer-to-double
+           #*1111111111110000000000000000000000000000000000000000000000000000)))
+      (assert-true (flo:negative? negative-infinity)))
+
     (assert-true
      (flo:nan?
       (integer-to-double
@@ -127,6 +138,15 @@ USA.
     (test-single -1.0
                 #*10111111100000000000000000000000)
 
+    ;; We should 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)))
+    (let ((negative-infinity
+          (integer-to-single #*11111111100000000000000000000000)))
+      (assert-true (flo:negative? negative-infinity)))
+
     (assert-true
      (flo:nan?
       (integer-to-single