aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1998-04-17 23:36:34 +0000
committerRichard M. Stallman <[email protected]>1998-04-17 23:36:34 +0000
commit3c32996351d062b891c7cfbfe6a7ce5c63bd2fc8 (patch)
tree679e8aa0330e13bb96aebc21fac0bfbb12901875 /src/lread.c
parent5ae07613263106995d4ec33b59901a2007c23f0f (diff)
(read1): Compute NaN and infinities using 0.0 in a
variable, to cope with compilers that think they are smarter than us.
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lread.c b/src/lread.c
index 0d7238ddf3..3df769115f 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -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);
}