Correctly handle NaN.
This commit is contained in:
parent
9fa229fc8d
commit
829d55ac9c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=165839
@ -49,6 +49,8 @@ modff(float x, float *iptr)
|
||||
} else { /* no fraction part */
|
||||
u_int32_t ix;
|
||||
*iptr = x*one;
|
||||
if (x != x) /* NaN */
|
||||
return x;
|
||||
GET_FLOAT_WORD(ix,x);
|
||||
SET_FLOAT_WORD(x,ix&0x80000000); /* return +-0 */
|
||||
return x;
|
||||
|
Loading…
Reference in New Issue
Block a user