summaryrefslogtreecommitdiffstats
path: root/winsup/mingw/mingwex/complex/csinh.c
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/mingw/mingwex/complex/csinh.c')
-rw-r--r--winsup/mingw/mingwex/complex/csinh.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/complex/csinh.c b/winsup/mingw/mingwex/complex/csinh.c
new file mode 100644
index 000000000..4ee6cbe86
--- /dev/null
+++ b/winsup/mingw/mingwex/complex/csinh.c
@@ -0,0 +1,21 @@
+/* csinh.c */
+/*
+ Contributed by Danny Smith
+ 2003-10-20
+*/
+
+
+#include <math.h>
+#include <complex.h>
+
+/* csinh (x + I * y) = sinh (x) * cos (y)
+ + I * (cosh (x) * sin (y)) */
+
+
+double complex csinh (double complex Z)
+{
+ double complex Res;
+ __real__ Res = sinh (__real__ Z) * cos (__imag__ Z);
+ __imag__ Res = cosh (__real__ Z) * sin (__imag__ Z);
+ return Res;
+}