From c643db8792102d1a2efad109f58139977d8608d6 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 23 Oct 2015 21:37:33 +0000 Subject: Fix j1, jn missing errno setting on underflow (bug 18611). j1 and jn can underflow for small arguments, but fail to set errno when underflowing to 0. This patch fixes them to set errno in that case. Tested for x86_64, x86, mips64 and powerpc. [BZ #18611] * sysdeps/ieee754/dbl-64/e_j1.c (__ieee754_j1): Set errno and avoid excess range and precision on underflow. * sysdeps/ieee754/dbl-64/e_jn.c (__ieee754_jn): Likewise. * sysdeps/ieee754/flt-32/e_j1f.c (__ieee754_j1f): Likewise. * sysdeps/ieee754/flt-32/e_jnf.c (__ieee754_jnf): Likewise. * sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_j1l): Set errno on underflow. * sysdeps/ieee754/ldbl-128/e_jnl.c (__ieee754_jnl): Likewise. * sysdeps/ieee754/ldbl-128ibm/e_jnl.c (__ieee754_jnl): Likewise. * sysdeps/ieee754/ldbl-96/e_j1l.c (__ieee754_j1l): Likewise. * sysdeps/ieee754/ldbl-96/e_jnl.c (__ieee754_jnl): Likewise. * math/auto-libm-test-in: Do not allow missing errno setting for tests of j1 and jn. * math/auto-libm-test-out: Regenerated. --- math/auto-libm-test-in | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'math/auto-libm-test-in') diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in index 3d7143f..b5308e3 100644 --- a/math/auto-libm-test-in +++ b/math/auto-libm-test-in @@ -2424,11 +2424,10 @@ j1 0x1p-60 j1 0x1p-100 j1 0x1p-600 j1 0x1p-10000 -# Bug 18611: errno setting may be missing. -j1 min missing-errno -j1 -min missing-errno -j1 min_subnorm missing-errno -j1 -min_subnorm missing-errno +j1 min +j1 -min +j1 min_subnorm +j1 -min_subnorm # jn (0, x) == j0 (x). jn 0 -1.0 @@ -2459,11 +2458,10 @@ jn 1 1.5 jn 1 2.0 jn 1 8.0 jn 1 10.0 -# Bug 18611: errno setting may be missing. -jn 1 min missing-errno -jn 1 -min missing-errno -jn 1 min_subnorm missing-errno -jn 1 -min_subnorm missing-errno +jn 1 min +jn 1 -min +jn 1 min_subnorm +jn 1 -min_subnorm jn 3 -1.0 jn 3 0.0 @@ -2504,11 +2502,10 @@ jn -2 -1 jn -3 -1 jn -4 -1 -# Bug 18611: errno setting may be missing. -jn 10 min missing-errno -jn 10 -min missing-errno -jn 10 min_subnorm missing-errno -jn 10 -min_subnorm missing-errno +jn 10 min +jn 10 -min +jn 10 min_subnorm +jn 10 -min_subnorm lgamma max lgamma 1 -- cgit v1.1