Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libm / common / sf_fdim.c
blob8fee57002f538debee73e14fe0ff919b7f8d8cc0
1 /* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
3 * Permission to use, copy, modify, and distribute this software
4 * is freely granted, provided that this notice is preserved.
5 */
7 #include "fdlibm.h"
9 #ifdef __STDC__
10 float fdimf(float x, float y)
11 #else
12 float fdimf(x,y)
13 float x;
14 float y;
15 #endif
17 if (__fpclassifyf(x) == FP_NAN) return(x);
18 if (__fpclassifyf(y) == FP_NAN) return(y);
20 return x > y ? x - y : 0.0;
23 #ifdef _DOUBLE_IS_32BITS
25 #ifdef __STDC__
26 double fdim(double x, double y)
27 #else
28 double fdim(x,y)
29 double x;
30 double y;
31 #endif
33 return (double) fdimf((float) x, (float) y);
36 #endif /* defined(_DOUBLE_IS_32BITS) */