wine/libs/musl/src/math/fmax.c
2023-04-04 09:43:51 +02:00

13 lines
250 B
C

#include <math.h>
double __cdecl fmax(double x, double y)
{
if (isnan(x))
return y;
if (isnan(y))
return x;
/* handle signed zeros, see C99 Annex F.9.9.2 */
if (signbit(x) != signbit(y))
return signbit(x) ? y : x;
return x < y ? y : x;
}