4 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
5 int ilogbl(long double x)
9 #elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384
10 int ilogbl(long double x)
12 union ldshape u = {x};
13 uint64_t m = u.bits.m;
22 for (e = -0x3fff+1; m < (uint64_t)1<<63; e--, m<<=1);
27 /* in ld80 msb is set in inf */
28 return m & (uint64_t)-1>>1 ? FP_ILOGBNAN : INT_MAX;