mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-10 05:30:45 -08:00
(read1): 0.0e+NaN should make a "positive" NaN.
This commit is contained in:
parent
cf44444173
commit
7690cbb0f9
1 changed files with 17 additions and 0 deletions
17
src/lread.c
17
src/lread.c
|
|
@ -2595,6 +2595,23 @@ read1 (readcharfun, pch, first_in_list)
|
|||
break;
|
||||
case 'N':
|
||||
value = zero / zero;
|
||||
|
||||
/* If that made a "negative" NaN, negate it. */
|
||||
|
||||
{
|
||||
int i;
|
||||
union { double d; char c[sizeof (double)]; } u_data, u_minus_zero;
|
||||
|
||||
u_data.d = value;
|
||||
u_minus_zero.d = - 0.0;
|
||||
for (i = 0; i < sizeof (double); i++)
|
||||
if (u_data.c[i] & u_minus_zero.c[i])
|
||||
{
|
||||
value = - value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* Now VALUE is a positive NaN. */
|
||||
break;
|
||||
default:
|
||||
value = atof (read_buffer + negative);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue