summaryrefslogtreecommitdiff
path: root/src/complex/CMPLXF.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/complex/CMPLXF.c')
-rw-r--r--src/complex/CMPLXF.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/complex/CMPLXF.c b/src/complex/CMPLXF.c
new file mode 100644
index 00000000..397e7ad7
--- /dev/null
+++ b/src/complex/CMPLXF.c
@@ -0,0 +1,16 @@
+#include <complex.h>
+
+#ifdef __STDC_IEC_559_COMPLEX__
+#define CMPLXF(__x, __y) \
+ ((float complex)((float)(__x) + _Imaginary_I * (float)(__y)))
+#else
+#define CMPLXF(__x, __y) \
+ (((union { \
+ float complex __c; \
+ float __f[2]; \
+ }){ .__f = { __x, __y } }).__c)
+#endif
+
+/*
+STDC(201112)
+*/