3 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
4 long double nextafterl(long double x, long double y)
6 return nextafter(x, y);
8 #elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384
9 #define MSB ((uint64_t)1<<63)
10 long double nextafterl(long double x, long double y)
14 if (isnan(x) || isnan(y))
22 ux.bits.sign = uy.bits.sign;
23 } else if (x < y ^ ux.bits.sign) {
25 if ((ux.bits.m & ~MSB) == 0) {
30 if ((ux.bits.m & ~MSB) == 0) {
37 /* raise overflow if ux.value is infinite and x is finite */
38 if (ux.bits.exp == 0x7fff)
40 /* raise underflow if ux.value is subnormal or zero */
41 if (ux.bits.exp == 0) {
42 volatile float z = x*x + ux.value*ux.value;
46 #elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384
47 long double nextafterl(long double x, long double y)
51 if (isnan(x) || isnan(y))
59 ux.bits.sign = uy.bits.sign;
60 } else if (x < y ^ ux.bits.sign) {
62 if (ux.bits.mlo == 0) {
68 if (ux.bits.mlo == 0) {
75 /* raise overflow if ux.value is infinite and x is finite */
76 if (ux.bits.exp == 0x7fff)
78 /* raise underflow if ux.value is subnormal or zero */
79 if (ux.bits.exp == 0) {
80 volatile float z = x*x + ux.value*ux.value;