aboutsummaryrefslogtreecommitdiff
path: root/math/s_fdimf.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/s_fdimf.c')
-rw-r--r--math/s_fdimf.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/math/s_fdimf.c b/math/s_fdimf.c
index b905380..2e8eccf 100644
--- a/math/s_fdimf.c
+++ b/math/s_fdimf.c
@@ -23,19 +23,11 @@
float
__fdimf (float x, float y)
{
- int clsx = fpclassify (x);
- int clsy = fpclassify (y);
-
- if (clsx == FP_NAN || clsy == FP_NAN)
- /* Raise invalid flag for signaling but not quiet NaN. */
- return x - y;
-
- if (x <= y)
+ if (islessequal (x, y))
return 0.0f;
float r = x - y;
- if (fpclassify (r) == FP_INFINITE
- && clsx != FP_INFINITE && clsy != FP_INFINITE)
+ if (isinf (r) && !isinf (x) && !isinf (y))
__set_errno (ERANGE);
return r;