OSDN Git Service

- add long double math wrappers (Ned Ludd)
[uclinux-h8/uclibc-ng.git] / libm / s_fmax.c
1 /* Copyright (C) 2002 by  Red Hat, Incorporated. All rights reserved.
2  *
3  * Permission to use, copy, modify, and distribute this software
4  * is freely granted, provided that this notice is preserved.
5  */
6
7 #include "math.h"
8 #include "math_private.h"
9
10 #ifdef __STDC__
11         double fmax(double x, double y)
12 #else
13         double fmax(x,y)
14         double x;
15         double y;
16 #endif
17 {
18   if (__fpclassify(x) == FP_NAN)
19     return x;
20   if (__fpclassify(y) == FP_NAN)
21     return y;
22
23   return x > y ? x : y;
24 }
25 libm_hidden_def(fmax)