Add some more spot checks. Zero is not exact here, for sign.
authorTaylor R Campbell <campbell@mumble.net>
Sat, 1 Dec 2018 22:49:17 +0000 (22:49 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sat, 1 Dec 2018 22:49:17 +0000 (22:49 +0000)
tests/runtime/test-ieee754.scm

index bf6d245046bbf3dc31d6661276173035cac3501e..0c23bca4105aec991418b6f8185b4adbefa54f5b 100644 (file)
@@ -49,7 +49,7 @@ USA.
           (biased-exponent (extract-bit-field w t bits))
           (trailing-significand (extract-bit-field t 0 bits)))
       (let ((x (compose sign biased-exponent trailing-significand)))
-        (assert (or (not (finite? x)) (exact? x)))
+        (assert (or (zero? x) (not (finite? x)) (exact? x)))
         ;; Confirm that it yields the same bits.
         (receive (sign* biased-exponent* trailing-significand*)
                  (decompose x)
@@ -76,8 +76,16 @@ USA.
     (#x0000000000000001)
     (#x1000000000000000)
     (#x1000000000000001)
+    (#x8000000000000000)
+    (#x8000000000000001)
     (#x7ff0000000000000)
     (#xfff0000000000000)
+    (#x7ff0000000000001)
+    (#xfff0000000000001)
+    (#x7ff8000000000000)
+    (#xfff8000000000000)
+    (#x7ff8000000000001)
+    (#xfff8000000000001)
     (#x0123456789abcdef)
     (#xfedcba9876543210))
   (test-ieee754-roundtrip 11 53