]> git.eshelyaron.com Git - emacs.git/commitdiff
(read1): Compute NaN and infinities using 0.0 in a
authorRichard M. Stallman <rms@gnu.org>
Fri, 17 Apr 1998 23:36:34 +0000 (23:36 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 17 Apr 1998 23:36:34 +0000 (23:36 +0000)
variable, to cope with compilers that think they are smarter than us.

src/lread.c

index 0d7238ddf3558368e97e565de7274bbd9b4fac54..3df769115f4f53e48fe8baf80a158caa40bb1c6a 100644 (file)
@@ -1916,6 +1916,7 @@ read1 (readcharfun, pch, first_in_list)
 #ifdef LISP_FLOAT_TYPE
            if (isfloat_string (read_buffer))
              {
+               double zero = 0.0;
                double value = atof (read_buffer);
                if (read_buffer[0] == '-' && value == 0.0)
                  value *= -1.0;
@@ -1924,11 +1925,11 @@ read1 (readcharfun, pch, first_in_list)
                if (p[-1] == 'F' || p[-1] == 'N')
                  {
                    if (p[-1] == 'N')
-                     value = 0.0 / 0.0;
+                     value = zero / zero;
                    else if (read_buffer[0] == '-')
-                     value = -1.0e999;
+                     value = - 1.0 / zero;
                    else
-                     value = 1.0e999;
+                     value = 1.0 / zero;
                  }
                return make_float (value);
              }