fail posix_spawn file_actions operations with negative fds
[musl] / src / complex / cacoshf.c
index d7e6b54..8bd8058 100644 (file)
@@ -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));
 }