Fix printing NaN sign.
authorTaylor R Campbell <campbell@mumble.net>
Fri, 7 Dec 2018 04:48:34 +0000 (04:48 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Fri, 7 Dec 2018 17:17:28 +0000 (17:17 +0000)
src/runtime/dragon4.scm
tests/runtime/test-readwrite.scm

index fbfd68c04813d13e6f34cd750289b8993726e3f9..eee2dcf6271b4d9d9842bb89ca7fc563455592ed 100644 (file)
@@ -90,7 +90,7 @@ not much different to numbers within a few orders of magnitude of 1.
     (or (and flonum-printer-hook
             (flonum-printer-hook x radix))
        (cond ((flo:nan? x)
-              "+nan.0")
+              (if (flo:sign-negative? x) "-nan.0" "+nan.0"))
              ((flo:positive? x)
               (if (flo:infinite? x)
                   "+inf.0"
index 7549078ee614766ee84b99482e88ae98a76d5932..0109790b77b3b8df49f51a32eba45d7efe2e36e2 100644 (file)
@@ -93,7 +93,7 @@ USA.
     ("inf.0" ,assert-symbol)
     ("nan.0" ,assert-symbol)
     ("+nan.0" ,assert-nan)
-    ("-nan.0" ,assert-nan ,expect-failure)
+    ("-nan.0" ,assert-nan)
     ("123" ,assert-exact-integer)
     ("1/34" ,assert-exact-rational)
     ("123+456i" ,assert-complex-nonreal)
@@ -117,8 +117,8 @@ USA.
     ("-inf.0-inf.0i" ,assert-complex-nonreal)
     ("+inf.0+nan.0i" ,assert-complex-nonreal)
     ("+nan.0+inf.0i" ,assert-complex-nonreal)
-    ("+inf.0-nan.0i" ,assert-complex-nonreal ,expect-failure)
-    ("-nan.0+inf.0i" ,assert-complex-nonreal ,expect-failure)
+    ("+inf.0-nan.0i" ,assert-complex-nonreal)
+    ("-nan.0+inf.0i" ,assert-complex-nonreal)
     ("\"|\"" ,assert-string)
     ("\"\\\"\"" ,assert-string)
     ("\"\\\\\"" ,assert-string)
@@ -138,7 +138,7 @@ USA.
     ("inf.0" ,assert-symbol)
     ("nan.0" ,assert-symbol)
     ("+nan.0" ,assert-nan)
-    ("-nan.0" ,assert-nan ,expect-failure)
+    ("-nan.0" ,assert-nan)
     ("#x123" ,assert-exact-integer)
     ("#x1/34" ,assert-exact-rational)
     ("#x123+456i" ,assert-complex-nonreal)
@@ -166,8 +166,8 @@ USA.
     ("#x-inf.0-inf.0i" ,assert-complex-nonreal)
     ("#x+inf.0+nan.0i" ,assert-complex-nonreal)
     ("#x+nan.0+inf.0i" ,assert-complex-nonreal)
-    ("#x+inf.0-nan.0i" ,assert-complex-nonreal ,expect-failure)
-    ("#x-nan.0+inf.0i" ,assert-complex-nonreal ,expect-failure))
+    ("#x+inf.0-nan.0i" ,assert-complex-nonreal)
+    ("#x-nan.0+inf.0i" ,assert-complex-nonreal))
   (lambda (string #!optional assertion xfail)
     (with-expected-failure xfail
       (lambda ()