Correctly handle inf/nan. This routine is currently unused because we
seem to have assembly versions for all architectures, but it can't hurt to fix it.
This commit is contained in:
parent
6642c3fa74
commit
9fa229fc8d
@ -55,6 +55,10 @@ modf(double x, double *iptr)
|
||||
}
|
||||
} else if (j0>51) { /* no fraction part */
|
||||
u_int32_t high;
|
||||
if (j0 == 0x400) { /* inf/NaN */
|
||||
*iptr = x;
|
||||
return 0.0 / x;
|
||||
}
|
||||
*iptr = x*one;
|
||||
GET_HIGH_WORD(high,x);
|
||||
INSERT_WORDS(x,high&0x80000000,0); /* return +-0 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user