nsz | 9560b6b | 2012-03-13 19:51:14 +0100 | [diff] [blame] | 1 | #include <math.h> |
Rich Felker | b69f695 | 2012-03-13 01:17:53 -0400 | [diff] [blame] | 2 | |
3 | float fmaxf(float x, float y) | ||||
4 | { | ||||
5 | if (isnan(x)) | ||||
6 | return y; | ||||
7 | if (isnan(y)) | ||||
8 | return x; | ||||
9 | /* handle signed zeroes, see C99 Annex F.9.9.2 */ | ||||
10 | if (signbit(x) != signbit(y)) | ||||
11 | return signbit(x) ? y : x; | ||||
12 | return x < y ? y : x; | ||||
13 | } |