This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix ynl return value with LDBL_MIN
- From: Andreas Jaeger <aj at suse dot com>
- To: libc-alpha at sourceware dot org
- Cc: Marek Polacek <polacek at redhat dot com>
- Date: Wed, 11 Jul 2012 12:01:48 +0200
- Subject: Re: [PATCH] Fix ynl return value with LDBL_MIN
- References: <20120528134625.GD3030@redhat.com> <Pine.LNX.4.64.1206081142520.3499@digraph.polyomino.org.uk> <20120711095536.GB6519@redhat.com>
On Wednesday, July 11, 2012 11:55:36 Marek Polacek wrote:
> On Fri, Jun 08, 2012 at 11:43:45AM +0000, Joseph S. Myers wrote:
> > If you want to get this one in first then you should send a version
> > adding a test to libm-test.inc (the test not conditioned, but only
> > testing exceptions and not errno - the other patch would then add
> > the errno tests for that test).
>
> Ok, so here it finally is:
I assume this is tested on x86-64 or x86? In that case: It's fine,
thanks!
Andreas
> 2012-07-11 Marek Polacek <polacek@redhat.com>
>
> [BZ #14173]
> * math/libm-test.inc (yn_test): Add test for BZ #14173.
> * sysdeps/ieee754/ldbl-96/e_jnl.c (__ieee754_ynl): Correct
> loop condition.
>
> --- libc/math/libm-test.inc.mp 2012-07-11 11:15:18.780520356 +0200
> +++ libc/math/libm-test.inc 2012-07-11 11:20:37.035186829 +0200
> @@ -9015,8 +9015,11 @@ yn_test (void)
> TEST_ff_f (yn, 10, 2.0, -129184.542208039282635913145923304214L);
> TEST_ff_f (yn, 10, 10.0, -0.359814152183402722051986577343560609L);
>
> - END (yn);
> + /* Check whether yn returns correct value for LDBL_MIN, DBL_MIN,
> + and FLT_MIN. See Bug 14173. */
> + TEST_ff_f (yn, 10, min_value, minus_infty, OVERFLOW_EXCEPTION);
>
> + END (yn);
> }
>
>
> --- libc/sysdeps/ieee754/ldbl-96/e_jnl.c.mp 2012-05-28
> 18:46:19.867400101 +0200 +++
> libc/sysdeps/ieee754/ldbl-96/e_jnl.c 2012-07-11 11:20:20.292151871
> +0200 @@ -360,7 +360,8 @@ __ieee754_ynl (int n, long double x)
> b = __ieee754_y1l (x);
> /* quit if b is -inf */
> GET_LDOUBLE_WORDS (se, i0, i1, b);
> - for (i = 1; i < n && se != 0xffff; i++)
> + /* Use 0xffffffff since GET_LDOUBLE_WORDS sign-extends SE. */
> + for (i = 1; i < n && se != 0xffffffff; i++)
> {
> temp = b;
> b = ((long double) (i + i) / x) * b - a;
>
> Marek
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126