Make NUMBER->STRING give negative flonum zero a minus sign.
authorTaylor R Campbell <campbell@mumble.net>
Tue, 4 Jun 2013 17:18:36 +0000 (17:18 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Tue, 4 Jun 2013 17:18:36 +0000 (17:18 +0000)
src/runtime/dragon4.scm

index 313bd887c7f870b7f37c7c2f88bba21d4b829925..98c04ffcd23991f2047f1342531bfd5f86abdfa7 100644 (file)
@@ -79,7 +79,8 @@ not much different to numbers within a few orders of magnitude of 1.
                     (string-copy "#[-inf]")
                     (string-append "-" (x>0 x)))))
              ((flo:zero? x)
-              (string-copy "0."))
+              ;; XXX Kludgey test for zero sign.
+              (string-copy (if (flo:negative? (flo:atan2 x -1.)) "-0." "0.")))
              (else
               (string-copy "#[NaN]"))))))