mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-02-05 20:43:08 +00:00
(read1): 0.0e+NaN should make a "positive" NaN.
This commit is contained in:
parent
cf44444173
commit
7690cbb0f9
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…
x
Reference in New Issue
Block a user