aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/libm-test.inc4
-rw-r--r--math/s_clog10.c5
-rw-r--r--math/s_clog10f.c5
-rw-r--r--math/s_clog10l.c5
4 files changed, 14 insertions, 5 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 9c4c2bf..cefcb96 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -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),
diff --git a/math/s_clog10.c b/math/s_clog10.c
index 417d561..e757879 100644
--- a/math/s_clog10.c
+++ b/math/s_clog10.c
@@ -25,6 +25,9 @@
/* log_10 (2). */
#define M_LOG10_2 0.3010299956639811952137388947244930267682
+/* pi * log10 (e). */
+#define M_PI_LOG10E 1.364376353841841347485783625431355770210
+
__complex__ double
__clog10 (__complex__ double x)
{
@@ -35,7 +38,7 @@ __clog10 (__complex__ double x)
if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
{
/* Real and imaginary part are 0.0. */
- __imag__ result = signbit (__real__ x) ? M_PI : 0.0;
+ __imag__ result = signbit (__real__ x) ? M_PI_LOG10E : 0.0;
__imag__ result = __copysign (__imag__ result, __imag__ x);
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabs (__real__ x);
diff --git a/math/s_clog10f.c b/math/s_clog10f.c
index a9120e0..ca2cdf4 100644
--- a/math/s_clog10f.c
+++ b/math/s_clog10f.c
@@ -25,6 +25,9 @@
/* log_10 (2). */
#define M_LOG10_2f 0.3010299956639811952137388947244930267682f
+/* pi * log10 (e). */
+#define M_PI_LOG10Ef 1.364376353841841347485783625431355770210f
+
__complex__ float
__clog10f (__complex__ float x)
{
@@ -35,7 +38,7 @@ __clog10f (__complex__ float x)
if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
{
/* Real and imaginary part are 0.0. */
- __imag__ result = signbit (__real__ x) ? M_PI : 0.0;
+ __imag__ result = signbit (__real__ x) ? M_PI_LOG10Ef : 0.0;
__imag__ result = __copysignf (__imag__ result, __imag__ x);
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabsf (__real__ x);
diff --git a/math/s_clog10l.c b/math/s_clog10l.c
index ac33a8f..cdb5d61 100644
--- a/math/s_clog10l.c
+++ b/math/s_clog10l.c
@@ -32,6 +32,9 @@
/* log_10 (2). */
#define M_LOG10_2l 0.3010299956639811952137388947244930267682L
+/* pi * log10 (e). */
+#define M_PI_LOG10El 1.364376353841841347485783625431355770210L
+
__complex__ long double
__clog10l (__complex__ long double x)
{
@@ -42,7 +45,7 @@ __clog10l (__complex__ long double x)
if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
{
/* Real and imaginary part are 0.0. */
- __imag__ result = signbit (__real__ x) ? M_PIl : 0.0;
+ __imag__ result = signbit (__real__ x) ? M_PI_LOG10El : 0.0;
__imag__ result = __copysignl (__imag__ result, __imag__ x);
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabsl (__real__ x);