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/cacoshf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/complex/cacoshf.c')
-rw-r--r--src/complex/cacoshf.c 5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/complex/cacoshf.c b/src/complex/cacoshf.c
index d7e6b545..8bd80581 100644
--- a/src/complex/cacoshf.c
+++ b/src/complex/cacoshf.c
@@ -2,6 +2,9 @@
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));
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月17日 14:28:25 +0000

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