diff --git a/newlib/libm/common/s_fdim.c b/newlib/libm/common/s_fdim.c index 73a027953..61a4908f3 100644 --- a/newlib/libm/common/s_fdim.c +++ b/newlib/libm/common/s_fdim.c @@ -49,11 +49,8 @@ ANSI C, POSIX. double y; #endif { - int c = __fpclassifyd(x); - if (c == FP_NAN) return(x); + if (__fpclassifyd(x) == FP_NAN) return(x); if (__fpclassifyd(y) == FP_NAN) return(y); - if (c == FP_INFINITE) - return HUGE_VAL; return x > y ? x - y : 0.0; } diff --git a/newlib/libm/common/sf_fdim.c b/newlib/libm/common/sf_fdim.c index fe349098b..8fee57002 100644 --- a/newlib/libm/common/sf_fdim.c +++ b/newlib/libm/common/sf_fdim.c @@ -14,11 +14,8 @@ float y; #endif { - int c = __fpclassifyf(x); - if (c == FP_NAN) return(x); + if (__fpclassifyf(x) == 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; }