summaryrefslogtreecommitdiff
path: root/src/complex/cacosh.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/complex/cacosh.c')
-rw-r--r--src/complex/cacosh.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/complex/cacosh.c b/src/complex/cacosh.c
index 8e42f1ae..76127f75 100644
--- a/src/complex/cacosh.c
+++ b/src/complex/cacosh.c
@@ -4,6 +4,9 @@
double complex cacosh(double complex z)
{
+ int zineg = signbit(cimag(z));
+
z = cacos(z);
- return CMPLX(-cimag(z), creal(z));
+ if (zineg) return CMPLX(cimag(z), -creal(z));
+ else return CMPLX(-cimag(z), creal(z));
}