initial cmath code and minor libm.h update
[libm] / src / cmath / ctan.c
diff --git a/src/cmath/ctan.c b/src/cmath/ctan.c
new file mode 100644 (file)
index 0000000..4462ef0
--- /dev/null
@@ -0,0 +1,9 @@
+#include "libm.h"
+
+double complex ctan(double complex z)
+{
+       double complex r;
+
+       r = ctanh(cpack(-cimag(z), creal(z)));
+       return cpack(cimag(r), -creal(r));
+}