diff options
Diffstat (limited to 'math/s_fmax_template.c')
-rw-r--r-- | math/s_fmax_template.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/math/s_fmax_template.c b/math/s_fmax_template.c index dea53d4..e855b72 100644 --- a/math/s_fmax_template.c +++ b/math/s_fmax_template.c @@ -22,7 +22,14 @@ FLOAT M_DECL_FUNC (__fmax) (FLOAT x, FLOAT y) { - return (isgreaterequal (x, y) || isnan (y)) ? x : y; + if (isgreaterequal (x, y)) + return x; + else if (isless (x, y)) + return y; + else if (issignaling (x) || issignaling (y)) + return x + y; + else + return isnan (y) ? x : y; } declare_mgen_alias (__fmax, fmax); |