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:
David Schultz 2007-01-06 21:22:38 +00:00
parent 6642c3fa74
commit 9fa229fc8d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=165838

View File

@ -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 */