musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/complex/cacosh.c
diff options
context:
space:
mode:
authorMichael Morrell <mmorrell@tachyum.com>2019年10月14日 09:07:31 -0400
committerRich Felker <dalias@aerifal.cx>2019年10月14日 09:08:22 -0400
commitaa2d23e57c9c95f0ffeb80cb035e5a5be52d8ef0 (patch)
tree85e6f04af86717b8984f132e84b01c484e20810d /src/complex/cacosh.c
parentea9525c8bcf6170df59364c4bcd616de1acf8703 (diff)
downloadmusl-aa2d23e57c9c95f0ffeb80cb035e5a5be52d8ef0.tar.gz
fix cacosh results for arguments with negative imaginary part
Diffstat (limited to 'src/complex/cacosh.c')
-rw-r--r--src/complex/cacosh.c 5
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));
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月16日 18:06:59 +0000

AltStyle によって変換されたページ (->オリジナル) /