diff options
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm')
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/s_erfl.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/s_logbl.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_erfl.c b/sysdeps/ieee754/ldbl-128ibm/s_erfl.c index 455c645561..82d889d14e 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_erfl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_erfl.c @@ -106,6 +106,7 @@ #include <math.h> #include <math_private.h> #include <math_ldbl_opt.h> +#include <fix-int-fp-convert-zero.h> /* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */ @@ -839,7 +840,10 @@ __erfcl (long double x) if (ix >= 0x7ff00000) { /* erfc(nan)=nan */ /* erfc(+-inf)=0,2 */ - return (long double) ((hx >> 31) << 1) + one / x; + long double ret = (long double) ((hx >> 31) << 1) + one / x; + if (FIX_INT_FP_CONVERT_ZERO && ret == 0.0L) + return 0.0L; + return ret; } if (ix < 0x3fd00000) /* |x| <1/4 */ diff --git a/sysdeps/ieee754/ldbl-128ibm/s_logbl.c b/sysdeps/ieee754/ldbl-128ibm/s_logbl.c index 22e5fc24c0..3c07c5e8e2 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_logbl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_logbl.c @@ -22,6 +22,7 @@ #include <math.h> #include <math_private.h> #include <math_ldbl_opt.h> +#include <fix-int-fp-convert-zero.h> long double __logbl (long double x) @@ -53,6 +54,8 @@ __logbl (long double x) if ((hxs ^ lx) < 0 && (lx & 0x7fffffffffffffffLL) != 0) rhx--; } + if (FIX_INT_FP_CONVERT_ZERO && rhx == 1023) + return 0.0L; return (long double) (rhx - 1023); } #ifndef __logbl |