4 double modf(double x, double *iptr)
6 union {double x; uint64_t n;} u = {x};
10 e = (int)(u.n>>52 & 0x7ff) - 0x3ff;
12 /* no fractional part */
15 if (e == 0x400 && u.n<<12 != 0) /* nan */
17 u.n &= (uint64_t)1<<63;
23 u.n &= (uint64_t)1<<63;
28 mask = (uint64_t)-1>>12 >> e;
29 if ((u.n & mask) == 0) {
31 u.n &= (uint64_t)1<<63;