From 661f59838235815b5073a0ef95f410003639519e Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sun, 16 Aug 2020 16:14:04 -0400 Subject: rename non-compiled files to *.h --- src/math/signbit.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/math/signbit.h (limited to 'src/math/signbit.h') diff --git a/src/math/signbit.h b/src/math/signbit.h new file mode 100644 index 00000000..77cc3977 --- /dev/null +++ b/src/math/signbit.h @@ -0,0 +1,23 @@ +#include + +#define signbit(__x) \ + (sizeof(__x) == sizeof(long double) ? \ + ((((union { \ + long double __f; \ + char __c[sizeof(__x)]; \ + }){.__f = (__x)}).__c[sizeof(__x)-1] & 0x80) == 0x80 ? 1 : 0) : \ + sizeof(__x) == sizeof(double) ? \ + ((((union { \ + double __f; \ + char __c[sizeof(__x)]; \ + }){.__f = (__x)}).__c[sizeof(__x)-1] & 0x80) == 0x80 ? 1 : 0) : \ + (((union { \ + float __f; \ + char __c[sizeof(__x)]; \ + }){.__f = (__x)}).__c[sizeof(__x)-1] & 0x80) == 0x80 ? 1 : 0) + + +/* +STDC(199901) +LINK(m) +*/ -- cgit v1.2.1