about summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/libm-test.inc4
-rw-r--r--math/s_cacos.c2
-rw-r--r--math/s_cacosf.c2
-rw-r--r--math/s_cacosl.c2
4 files changed, 7 insertions, 3 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index b4177e8f8e..de7bc8ad94 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -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[] =
diff --git a/math/s_cacos.c b/math/s_cacos.c
index d0aaba4e6a..2c22817d4d 100644
--- a/math/s_cacos.c
+++ b/math/s_cacos.c
@@ -34,6 +34,8 @@ __cacos (__complex__ double x)
       y = __casin (x);
 
       __real__ res = (double) M_PI_2 - __real__ y;
+      if (__real__ res == 0.0)
+	__real__ res = 0.0;
       __imag__ res = -__imag__ y;
     }
   else
diff --git a/math/s_cacosf.c b/math/s_cacosf.c
index 9eaeeec53d..1c9d8b9186 100644
--- a/math/s_cacosf.c
+++ b/math/s_cacosf.c
@@ -34,6 +34,8 @@ __cacosf (__complex__ float x)
       y = __casinf (x);
 
       __real__ res = (float) M_PI_2 - __real__ y;
+      if (__real__ res == 0.0f)
+	__real__ res = 0.0f;
       __imag__ res = -__imag__ y;
     }
   else
diff --git a/math/s_cacosl.c b/math/s_cacosl.c
index b9d34930d6..8688d3cd36 100644
--- a/math/s_cacosl.c
+++ b/math/s_cacosl.c
@@ -34,6 +34,8 @@ __cacosl (__complex__ long double x)
       y = __casinl (x);
 
       __real__ res = M_PI_2l - __real__ y;
+      if (__real__ res == 0.0L)
+	__real__ res = 0.0L;
       __imag__ res = -__imag__ y;
     }
   else