3 double modf(double x, double *iptr)
5 union {double x; uint64_t n;} u = {x};
9 e = (int)(u.n>>52 & 0x7ff) - 0x3ff;
11 /* no fractional part */
14 if (e == 0x400 && u.n<<12 != 0) /* nan */
16 u.n &= (uint64_t)1<<63;
22 u.n &= (uint64_t)1<<63;
27 mask = (uint64_t)-1>>12 >> e;
28 if ((u.n & mask) == 0) {
30 u.n &= (uint64_t)1<<63;
35 STRICT_ASSIGN(double, x, x - *iptr);