Mercurial > emacs
changeset 21636:10d8ced94467
(read1): Compute NaN and infinities using 0.0 in a
variable, to cope with compilers that think they are smarter than us.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 17 Apr 1998 23:36:34 +0000 |
parents | 83541dfdf8ee |
children | 0bd76a1c9172 |
files | src/lread.c |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lread.c Fri Apr 17 23:35:14 1998 +0000 +++ b/src/lread.c Fri Apr 17 23:36:34 1998 +0000 @@ -1916,6 +1916,7 @@ #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 @@ 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); }