summaryrefslogtreecommitdiffstats
path: root/winsup/mingw/mingwex/complex/catanh.c
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/mingw/mingwex/complex/catanh.c')
-rw-r--r--winsup/mingw/mingwex/complex/catanh.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/complex/catanh.c b/winsup/mingw/mingwex/complex/catanh.c
new file mode 100644
index 000000000..78f028014
--- /dev/null
+++ b/winsup/mingw/mingwex/complex/catanh.c
@@ -0,0 +1,23 @@
+/* catanh.c */
+/*
+ Contributed by Danny Smith
+ 2003-10-20
+*/
+
+#include <math.h>
+#include <complex.h>
+
+/* catanh (z) = -I * catan (I * z) */
+
+double complex catanh (double complex Z)
+{
+ double complex Tmp;
+ double complex Res;
+
+ __real__ Tmp = - __imag__ Z;
+ __imag__ Tmp = __real__ Z;
+ Tmp = catan (Tmp);
+ __real__ Res = __imag__ Tmp;
+ __imag__ Res = - __real__ Tmp;
+ return Res;
+}