3 double nextafter(double x, double y)
5 union {double f; uint64_t i;} ux={x}, uy={y};
9 if (isnan(x) || isnan(y))
18 ux.i = (uy.i & 1ULL<<63) | 1;
19 } else if (ax > ay || ((ux.i ^ uy.i) & 1ULL<<63))
23 e = ux.i >> 52 & 0x7ff;
24 /* raise overflow if ux.f is infinite and x is finite */
27 /* raise underflow if ux.f is subnormal or zero */
29 FORCE_EVAL(x*x + ux.f*ux.f);