re PR libfortran/12839 (incorrect IO of Inf)
authorBud Davis <bdavis9659@comcast.net>
Mon, 28 Jun 2004 01:30:26 +0000 (01:30 +0000)
committerBud Davis <bdavis@gcc.gnu.org>
Mon, 28 Jun 2004 01:30:26 +0000 (01:30 +0000)
2004-06-27  Bud Davis  <bdavis9659@comcast.net>

        PR gfortran/12839
        * io/write.c (write_float): check signbit for Infinity.

From-SVN: r83757

libgfortran/ChangeLog
libgfortran/io/write.c

index b1babff4f6da39b7b954b4f3020de037983cdee1..65841f833f7a72aa475ebe4162edc82e614eda40 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-27  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/12839
+       * io/write.c (write_float): check signbit for Infinity.
+
 2004-06-26  Bud Davis  <bdavis9659@comcast.net>
 
        PR gfortran/16196
index e4f597cbd040254934275ad2777aad4eb9d6421d..3602c1b9157d60b739d07e10a32c4cddacbbb52b 100644 (file)
@@ -523,13 +523,13 @@ write_float (fnode *f, const char *source, int len)
          }
 
          memset(p, ' ', nb);
-         res = isinf (n);
+         res = isinf (n); 
          if (res != 0)
          {
-            if (res > 0)
-               fin = '+';
-            else
+            if (signbit(n))   
                fin = '-';
+            else
+               fin = '+';
 
             if (nb > 7)
                memcpy(p + nb - 8, "Infinity", 8);