Commit 3c329963 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(read1): Compute NaN and infinities using 0.0 in a

variable, to cope with compilers that think they are smarter than us.
parent 5ae07613
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment