summaryrefslogtreecommitdiff
path: root/src/complex/CMPLXL.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/CMPLXL.h
parent26263389556d583a16e26834c7f14bb7be7b3b17 (diff)
rename non-compiled files to *.h
Diffstat (limited to 'src/complex/CMPLXL.h')
-rw-r--r--src/complex/CMPLXL.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/complex/CMPLXL.h b/src/complex/CMPLXL.h
new file mode 100644
index 00000000..8e820512
--- /dev/null
+++ b/src/complex/CMPLXL.h
@@ -0,0 +1,17 @@
+#include <complex.h>
+
+#ifdef __STDC_IEC_559_COMPLEX__
+#define CMPLXL(__x, __y) \
+ ((long double complex)((long double)(__x) + \
+ _Imaginary_I * (long double)(__y)))
+#else
+#define CMPLXL(__x, __y) \
+ (((union { \
+ long double complex __c; \
+ long double __ld[2]; \
+ }){ .__ld = { __x, __y } }).__c)
+#endif
+
+/*
+STDC(201112)
+*/