summaryrefslogtreecommitdiff
path: root/src/complex/cimag.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/complex/cimag.c')
-rw-r--r--src/complex/cimag.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/complex/cimag.c b/src/complex/cimag.c
new file mode 100644
index 00000000..5e1ad46b
--- /dev/null
+++ b/src/complex/cimag.c
@@ -0,0 +1,7 @@
+#include "libm.h"
+
+double (cimag)(double complex z)
+{
+ union dcomplex u = {z};
+ return u.a[1];
+}