OSDN Git Service

*: document __USE_EXTERN_INLINES better;
[uclinux-h8/uClibc.git] / libm / s_fdim.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 fdim(double x, double y)
12 #else
13         double fdim(x,y)
14         double x;
15         double y;
16 #endif
17 {
18   int c = __fpclassify(x);
19   if (c == FP_NAN || c == FP_INFINITE)
20     return HUGE_VAL;
21
22   return x > y ? x - y : 0.0;
23 }
24 libm_hidden_def(fdim)