OSDN Git Service

r288@cf-ppc-macosx: monabuilder | 2008-12-07 13:17:34 +0900
[pf3gnuchains/pf3gnuchains3x.git] / newlib / libm / common / 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 "fdlibm.h"
8
9 #ifndef _DOUBLE_IS_32BITS
10
11 #ifdef __STDC__
12         double fmax(double x, double y)
13 #else
14         double fmax(x,y)
15         double x;
16         double y;
17 #endif
18 {
19   if (__fpclassifyd(x) == FP_NAN)
20     return y;
21   if (__fpclassifyd(y) == FP_NAN)
22     return x;
23   
24   return x > y ? x : y;
25 }
26
27 #endif /* _DOUBLE_IS_32BITS */