diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/ieee754/dbl-64/e_j1.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/flt-32/e_j1f.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/e_j1l.c | 8 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-96/e_j1l.c | 6 |
4 files changed, 22 insertions, 4 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_j1.c b/sysdeps/ieee754/dbl-64/e_j1.c index bc7ca06..b7b8a9a 100644 --- a/sysdeps/ieee754/dbl-64/e_j1.c +++ b/sysdeps/ieee754/dbl-64/e_j1.c @@ -58,6 +58,7 @@ * by method mentioned above. */ +#include <errno.h> #include <math.h> #include <math_private.h> @@ -205,7 +206,10 @@ __ieee754_y1 (double x) } if (__glibc_unlikely (ix <= 0x3c900000)) /* x < 2**-54 */ { - return (-tpi / x); + z = -tpi / x; + if (__isinf (z)) + __set_errno (ERANGE); + return z; } z = x * x; u1 = U0[0] + z * U0[1]; z2 = z * z; diff --git a/sysdeps/ieee754/flt-32/e_j1f.c b/sysdeps/ieee754/flt-32/e_j1f.c index a180968..920e4b8 100644 --- a/sysdeps/ieee754/flt-32/e_j1f.c +++ b/sysdeps/ieee754/flt-32/e_j1f.c @@ -13,6 +13,7 @@ * ==================================================== */ +#include <errno.h> #include <math.h> #include <math_private.h> @@ -135,7 +136,10 @@ __ieee754_y1f(float x) return z; } if(__builtin_expect(ix<=0x33000000, 0)) { /* x < 2**-25 */ - return(-tpi/x); + z = -tpi / x; + if (__isinff (z)) + __set_errno (ERANGE); + return z; } z = x*x; u = U0[0]+z*(U0[1]+z*(U0[2]+z*(U0[3]+z*U0[4]))); diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c index 1264c95..f24dfa9 100644 --- a/sysdeps/ieee754/ldbl-128/e_j1l.c +++ b/sysdeps/ieee754/ldbl-128/e_j1l.c @@ -95,6 +95,7 @@ License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#include <errno.h> #include <math.h> #include <math_private.h> #include <float.h> @@ -852,7 +853,12 @@ __ieee754_y1l (long double x) } xx = fabsl (x); if (xx <= 0x1p-114) - return -TWOOPI / x; + { + z = -TWOOPI / x; + if (__isinfl (z)) + __set_errno (ERANGE); + return z; + } if (xx <= 2.0L) { /* 0 <= x <= 2 */ diff --git a/sysdeps/ieee754/ldbl-96/e_j1l.c b/sysdeps/ieee754/ldbl-96/e_j1l.c index 5c0a2e1..88fcf13 100644 --- a/sysdeps/ieee754/ldbl-96/e_j1l.c +++ b/sysdeps/ieee754/ldbl-96/e_j1l.c @@ -71,6 +71,7 @@ * by method mentioned above. */ +#include <errno.h> #include <math.h> #include <math_private.h> @@ -234,7 +235,10 @@ __ieee754_y1l (long double x) } if (__glibc_unlikely (ix <= 0x3fbe)) { /* x < 2**-65 */ - return (-tpi / x); + z = -tpi / x; + if (__isinfl (z)) + __set_errno (ERANGE); + return z; } z = x * x; u = U0[0] + z * (U0[1] + z * (U0[2] + z * (U0[3] + z * (U0[4] + z * U0[5])))); |