about summary refs log tree commit diff
path: root/src/complex/ccos.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/complex/ccos.c')
-rw-r--r--src/complex/ccos.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/complex/ccos.c b/src/complex/ccos.c
new file mode 100644
index 00000000..5754c238
--- /dev/null
+++ b/src/complex/ccos.c
@@ -0,0 +1,8 @@
+#include "libm.h"
+
+/* cos(z) = cosh(i z) */
+
+double complex ccos(double complex z)
+{
+	return ccosh(cpack(-cimag(z), creal(z)));
+}