source:
EcnlProtoTool/trunk/musl-1.1.18/src/math/fminl.c
Last change on this file was 444, checked in by , 4 years ago | |
---|---|
|
|
File size: 410 bytes |
Rev | Line | |
---|---|---|
[444] | 1 | #include <math.h> |
2 | #include <float.h> | |
3 | ||
4 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 | |
5 | long double fminl(long double x, long double y) | |
6 | { | |
7 | return fmin(x, y); | |
8 | } | |
9 | #else | |
10 | long double fminl(long double x, long double y) | |
11 | { | |
12 | if (isnan(x)) | |
13 | return y; | |
14 | if (isnan(y)) | |
15 | return x; | |
16 | /* handle signed zeros, see C99 Annex F.9.9.2 */ | |
17 | if (signbit(x) != signbit(y)) | |
18 | return signbit(x) ? x : y; | |
19 | return x < y ? x : y; | |
20 | } | |
21 | #endif |
Note:
See TracBrowser
for help on using the repository browser.