summaryrefslogtreecommitdiff
path: root/src/complex/CMPLXF.h
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-08-16 18:06:21 -0400
committerJakob Kaivo <jkk@ung.org>2020-08-16 18:06:21 -0400
commit48d2528a5b7b031111fa24c53ca28d3ddc436a79 (patch)
tree6d74b997546f82a58a2aaffc4b92703314bf058c /src/complex/CMPLXF.h
parent26263389556d583a16e26834c7f14bb7be7b3b17 (diff)
rename non-compiled files to *.h
Diffstat (limited to 'src/complex/CMPLXF.h')
-rw-r--r--src/complex/CMPLXF.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/complex/CMPLXF.h b/src/complex/CMPLXF.h
new file mode 100644
index 00000000..397e7ad7
--- /dev/null
+++ b/src/complex/CMPLXF.h
@@ -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)
+*/