diff options
Diffstat (limited to 'src/math/__signbit.c')
-rw-r--r-- | src/math/__signbit.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/math/__signbit.c b/src/math/__signbit.c new file mode 100644 index 00000000..ffe717ce --- /dev/null +++ b/src/math/__signbit.c @@ -0,0 +1,13 @@ +#include "libm.h" + +// FIXME: macro +int __signbit(double x) +{ + union { + double d; + uint64_t i; + } y = { x }; + return y.i>>63; +} + + |