Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libm/common/sf_fdim.c')
-rw-r--r--newlib/libm/common/sf_fdim.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/newlib/libm/common/sf_fdim.c b/newlib/libm/common/sf_fdim.c
index 80221ace1..fe349098b 100644
--- a/newlib/libm/common/sf_fdim.c
+++ b/newlib/libm/common/sf_fdim.c
@@ -15,8 +15,10 @@
#endif
{
int c = __fpclassifyf(x);
- if (c == FP_NAN || c == FP_INFINITE)
- return HUGE_VAL;
+ if (c == FP_NAN) return(x);
+ if (__fpclassifyf(y) == FP_NAN) return(y);
+ if (c == FP_INFINITE)
+ return HUGE_VALF;
return x > y ? x - y : 0.0;
}