1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Fix cacos (+Inf + finite*i) in round-downward mode (bug 16928).

According to C99/C11 Annex G, cacos applied to a value with real part
+Inf and finite imaginary part should produce a result with real part
+0.  glibc wrongly produces a result with real part -0 in FE_DOWNWARD
mode.  This patch fixes this by checking for zero results in the
relevant case of non-finite arguments (where there should never be a
result with -0 real part), and converts the tests of cacos to
ALL_RM_TEST.

Tested x86_64 and x86 and ulps updated accordingly.

	[BZ #16928]
	* math/s_cacos.c (__cacos): Ensure zero real part of result from
	non-finite arguments is +0.
	* math/s_cacosf.c (__cacosf): Likewise.
	* math/s_cacosl.c (__cacosl): Likewise.
	* math/libm-test.inc (cacos_test): Use ALL_RM_TEST.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
This commit is contained in:
Joseph Myers
2014-05-14 12:37:24 +00:00
parent 913d03c864
commit 01dbacd22a
8 changed files with 113 additions and 4 deletions

View File

@ -2615,9 +2615,7 @@ static const struct test_c_c_data cacos_test_data[] =
static void
cacos_test (void)
{
START (cacos, 0);
RUN_TEST_LOOP_c_c (cacos, cacos_test_data, );
END_COMPLEX;
ALL_RM_TEST (cacos, 0, cacos_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX);
}
static const struct test_c_c_data cacosh_test_data[] =