adapt res_msend DNS query core for working with multiple sockets
[musl] / src / complex / casinf.c
index 93f0e33..2cda2f0 100644 (file)
@@ -1,4 +1,4 @@
-#include "libm.h"
+#include "complex_impl.h"
 
 // FIXME
 
@@ -10,5 +10,6 @@ float complex casinf(float complex z)
        x = crealf(z);
        y = cimagf(z);
        w = CMPLXF(1.0 - (x - y)*(x + y), -2.0*x*y);
-       return clogf(CMPLXF(-y, x) + csqrtf(w));
+       float complex r = clogf(CMPLXF(-y, x) + csqrtf(w));
+       return CMPLXF(cimagf(r), -crealf(r));
 }