summaryrefslogtreecommitdiff
path: root/src/complex/cacoshf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/complex/cacoshf.c')
-rw-r--r--src/complex/cacoshf.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/complex/cacoshf.c b/src/complex/cacoshf.c
index ade01c09..8bd80581 100644
--- a/src/complex/cacoshf.c
+++ b/src/complex/cacoshf.c
@@ -1,7 +1,10 @@
-#include "libm.h"
+#include "complex_impl.h"
float complex cacoshf(float complex z)
{
+ int zineg = signbit(cimagf(z));
+
z = cacosf(z);
- return CMPLXF(-cimagf(z), crealf(z));
+ if (zineg) return CMPLXF(cimagf(z), -crealf(z));
+ else return CMPLXF(-cimagf(z), crealf(z));
}