|
@@ -26,16 +26,16 @@ static const double one = 1.0;
|
|
|
|
|
|
double modf(double x, double *iptr)
|
|
double modf(double x, double *iptr)
|
|
{
|
|
{
|
|
- int32_t i0,i1,j0;
|
|
|
|
|
|
+ int32_t i0,i1,_j0;
|
|
u_int32_t i;
|
|
u_int32_t i;
|
|
EXTRACT_WORDS(i0,i1,x);
|
|
EXTRACT_WORDS(i0,i1,x);
|
|
- j0 = ((i0>>20)&0x7ff)-0x3ff; /* exponent of x */
|
|
|
|
- if(j0<20) { /* integer part in high x */
|
|
|
|
- if(j0<0) { /* |x|<1 */
|
|
|
|
|
|
+ _j0 = ((i0>>20)&0x7ff)-0x3ff; /* exponent of x */
|
|
|
|
+ if(_j0<20) { /* integer part in high x */
|
|
|
|
+ if(_j0<0) { /* |x|<1 */
|
|
INSERT_WORDS(*iptr,i0&0x80000000,0); /* *iptr = +-0 */
|
|
INSERT_WORDS(*iptr,i0&0x80000000,0); /* *iptr = +-0 */
|
|
return x;
|
|
return x;
|
|
} else {
|
|
} else {
|
|
- i = (0x000fffff)>>j0;
|
|
|
|
|
|
+ i = (0x000fffff)>>_j0;
|
|
if(((i0&i)|i1)==0) { /* x is integral */
|
|
if(((i0&i)|i1)==0) { /* x is integral */
|
|
*iptr = x;
|
|
*iptr = x;
|
|
INSERT_WORDS(x,i0&0x80000000,0); /* return +-0 */
|
|
INSERT_WORDS(x,i0&0x80000000,0); /* return +-0 */
|
|
@@ -45,15 +45,15 @@ double modf(double x, double *iptr)
|
|
return x - *iptr;
|
|
return x - *iptr;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- } else if (j0>51) { /* no fraction part */
|
|
|
|
|
|
+ } else if (_j0>51) { /* no fraction part */
|
|
*iptr = x*one;
|
|
*iptr = x*one;
|
|
/* We must handle NaNs separately. */
|
|
/* We must handle NaNs separately. */
|
|
- if (j0 == 0x400 && ((i0 & 0xfffff) | i1))
|
|
|
|
|
|
+ if (_j0 == 0x400 && ((i0 & 0xfffff) | i1))
|
|
return x*one;
|
|
return x*one;
|
|
INSERT_WORDS(x,i0&0x80000000,0); /* return +-0 */
|
|
INSERT_WORDS(x,i0&0x80000000,0); /* return +-0 */
|
|
return x;
|
|
return x;
|
|
} else { /* fraction part in low x */
|
|
} else { /* fraction part in low x */
|
|
- i = ((u_int32_t)(0xffffffff))>>(j0-20);
|
|
|
|
|
|
+ i = ((u_int32_t)(0xffffffff))>>(_j0-20);
|
|
if((i1&i)==0) { /* x is integral */
|
|
if((i1&i)==0) { /* x is integral */
|
|
*iptr = x;
|
|
*iptr = x;
|
|
INSERT_WORDS(x,i0&0x80000000,0); /* return +-0 */
|
|
INSERT_WORDS(x,i0&0x80000000,0); /* return +-0 */
|