Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libm / common / s_fmin.c
blob9217c025184fdb89fe4420d87fb89df6f0cf163b
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 */
6 /*
7 FUNCTION
8 <<fmin>>, <<fminf>>---minimum
9 INDEX
10 fmin
11 INDEX
12 fminf
14 SYNOPSIS
15 #include <math.h>
16 double fmin(double <[x]>, double <[y]>);
17 float fminf(float <[x]>, float <[y]>);
19 DESCRIPTION
20 The <<fmin>> functions determine the minimum numeric value of their arguments.
21 NaN arguments are treated as missing data: if one argument is a NaN and the
22 other numeric, then the <<fmin>> functions choose the numeric value.
24 RETURNS
25 The <<fmin>> functions return the minimum numeric value of their arguments.
27 PORTABILITY
28 ANSI C, POSIX.
32 #include "fdlibm.h"
34 #ifndef _DOUBLE_IS_32BITS
36 #ifdef __STDC__
37 double fmin(double x, double y)
38 #else
39 double fmin(x,y)
40 double x;
41 double y;
42 #endif
44 if (__fpclassifyd(x) == FP_NAN)
45 return y;
46 if (__fpclassifyd(y) == FP_NAN)
47 return x;
49 return x < y ? x : y;
52 #endif /* _DOUBLE_IS_32BITS */