diff options
Diffstat (limited to 'sysdeps/ieee754/flt-32/s_erff.c')
-rw-r--r-- | sysdeps/ieee754/flt-32/s_erff.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sysdeps/ieee754/flt-32/s_erff.c b/sysdeps/ieee754/flt-32/s_erff.c index 3162d81..c8b6287 100644 --- a/sysdeps/ieee754/flt-32/s_erff.c +++ b/sysdeps/ieee754/flt-32/s_erff.c @@ -21,6 +21,7 @@ static char rcsid[] = "$NetBSD: s_erff.c,v 1.4 1995/05/10 20:47:07 jtc Exp $"; #include <float.h> #include <math.h> #include <math_private.h> +#include <fix-int-fp-convert-zero.h> static const float tiny = 1e-30, @@ -161,7 +162,10 @@ float __erfcf(float x) ix = hx&0x7fffffff; if(ix>=0x7f800000) { /* erfc(nan)=nan */ /* erfc(+-inf)=0,2 */ - return (float)(((u_int32_t)hx>>31)<<1)+one/x; + float ret = (float)(((u_int32_t)hx>>31)<<1)+one/x; + if (FIX_INT_FP_CONVERT_ZERO && ret == 0.0f) + return 0.0f; + return ret; } if(ix < 0x3f580000) { /* |x|<0.84375 */ |