fix getaddrinfo regression with AI_ADDRCONFIG on some configurations
[musl.git] / src / math / fmaxl.c
blob4b03158e06292b28576615a2a1dd36bd6bf1d34a
1 #include <math.h>
2 #include <float.h>
4 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
5 long double fmaxl(long double x, long double y)
7 return fmax(x, y);
9 #else
10 long double fmaxl(long double x, long double y)
12 if (isnan(x))
13 return y;
14 if (isnan(y))
15 return x;
16 /* handle signed zeros, see C99 Annex F.9.9.2 */
17 if (signbit(x) != signbit(y))
18 return signbit(x) ? y : x;
19 return x < y ? y : x;
21 #endif