aboutsummaryrefslogtreecommitdiff
path: root/math/s_fmin_template.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/s_fmin_template.c')
-rw-r--r--math/s_fmin_template.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/math/s_fmin_template.c b/math/s_fmin_template.c
index b70989a..82009bb 100644
--- a/math/s_fmin_template.c
+++ b/math/s_fmin_template.c
@@ -23,7 +23,14 @@
FLOAT
M_DECL_FUNC (__fmin) (FLOAT x, FLOAT y)
{
- return (islessequal (x, y) || isnan (y)) ? x : y;
+ if (islessequal (x, y))
+ return x;
+ else if (isgreater (x, y))
+ return y;
+ else if (issignaling (x) || issignaling (y))
+ return x + y;
+ else
+ return isnan (y) ? x : y;
}
declare_mgen_alias (__fmin, fmin);