about summary refs log tree commit diff
path: root/src/complex/casinl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/complex/casinl.c')
-rw-r--r--src/complex/casinl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/complex/casinl.c b/src/complex/casinl.c
index 0916c60f..3b7ceba7 100644
--- a/src/complex/casinl.c
+++ b/src/complex/casinl.c
@@ -15,6 +15,7 @@ long double complex casinl(long double complex z)
 	x = creall(z);
 	y = cimagl(z);
 	w = CMPLXL(1.0 - (x - y)*(x + y), -2.0*x*y);
-	return clogl(CMPLXL(-y, x) + csqrtl(w));
+	long double complex r = clogl(CMPLXL(-y, x) + csqrtl(w));
+	return CMPLXL(cimagl(r), -creall(r));
 }
 #endif