This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Use M_PI_34l consistently in libm-test.inc
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 09 May 2013 09:23:56 -0400
- Subject: Re: Use M_PI_34l consistently in libm-test.inc
- References: <Pine dot LNX dot 4 dot 64 dot 1305091242230 dot 27366 at digraph dot polyomino dot org dot uk>
On 05/09/2013 08:43 AM, Joseph S. Myers wrote:
> Two tests of carg use "3 * M_PI_4l" (or equivalent with -3), which
> isn't necessarily an exact multiplication. To avoid any issues with
> lack of constant folding for IBM long double (as described in
> <http://sourceware.org/ml/libc-alpha/2013-05/msg00221.html>), these
> should use something that can be constant-folded instead, and since
> libm-test.inc defines M_PI_34l, that may as well be used directly in
> these tests, which this patch does.
>
> Tested x86_64 and x86; no ulps changes needed.
>
> 2013-05-09 Joseph Myers <joseph@codesourcery.com>
>
> * math/libm-test.inc (carg_test): Use M_PI_34l instead of 3 *
> M_PI_4l.
>
> diff --git a/math/libm-test.inc b/math/libm-test.inc
> index 6294f72..160f2a8 100644
> --- a/math/libm-test.inc
> +++ b/math/libm-test.inc
> @@ -3031,9 +3031,9 @@ carg_test (void)
>
> TEST_c_f (carg, plus_infty, minus_infty, -M_PI_4l);
>
> - TEST_c_f (carg, minus_infty, plus_infty, 3 * M_PI_4l);
> + TEST_c_f (carg, minus_infty, plus_infty, M_PI_34l);
>
> - TEST_c_f (carg, minus_infty, minus_infty, -3 * M_PI_4l);
> + TEST_c_f (carg, minus_infty, minus_infty, -M_PI_34l);
>
> TEST_c_f (carg, qnan_value, qnan_value, qnan_value);
>
>
OK.
Cheers,
Carlos.