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

Fix clog10 (-0 +/- 0i) (bug 16362).

This patch fixes the imaginary part of clog10 (-0 +/- 0i), which
should be +/-pi / log(10) by analogy with clog (the functions were
wrongly returning a result with imaginary part +/-pi, same as for
clog, and the tests matched the incorrect result, though both
functions and tests were correct for the similar case of clog10 (-inf
+/- 0i)).  Tested x86_64 and x86.

	[BZ #16362]
	* math/s_clog10.c (M_PI_LOG10E): New macro.
	(__clog10): Use M_PI_LOG10E instead of M_PI when real and
	imaginary parts are 0.
	* math/s_clog10f.c (M_PI_LOG10Ef): New macro.
	(__clog10f): Use M_PI_LOG10Ef instead of M_PI when real and
	imaginary parts are 0.
	* math/s_clog10l.c (M_PI_LOG10El): New macro.
	(__clog10l): Use M_PI_LOG10El instead of M_PIl when real and
	imaginary parts are 0.
	* math/libm-test.inc (clog10_test_data): Update expected results
	for when real and imaginary parts are 0.
This commit is contained in:
Joseph Myers
2014-03-28 20:53:32 +00:00
parent 277ae3f186
commit 289e077957
6 changed files with 34 additions and 10 deletions

View File

@ -6130,8 +6130,8 @@ clog_test (void)
static const struct test_c_c_data clog10_test_data[] =
{
TEST_c_c (clog10, minus_zero, 0, minus_infty, M_PIl, DIVIDE_BY_ZERO_EXCEPTION),
TEST_c_c (clog10, minus_zero, minus_zero, minus_infty, -M_PIl, DIVIDE_BY_ZERO_EXCEPTION),
TEST_c_c (clog10, minus_zero, 0, minus_infty, M_PI_LOG10El, DIVIDE_BY_ZERO_EXCEPTION),
TEST_c_c (clog10, minus_zero, minus_zero, minus_infty, -M_PI_LOG10El, DIVIDE_BY_ZERO_EXCEPTION),
TEST_c_c (clog10, 0, 0, minus_infty, 0.0, DIVIDE_BY_ZERO_EXCEPTION),
TEST_c_c (clog10, 0, minus_zero, minus_infty, minus_zero, DIVIDE_BY_ZERO_EXCEPTION),