aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/options/ansi/musl-generic-math/__signbit.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mlibc/options/ansi/musl-generic-math/__signbit.c')
-rw-r--r--lib/mlibc/options/ansi/musl-generic-math/__signbit.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/mlibc/options/ansi/musl-generic-math/__signbit.c b/lib/mlibc/options/ansi/musl-generic-math/__signbit.c
new file mode 100644
index 0000000..e700b6b
--- /dev/null
+++ b/lib/mlibc/options/ansi/musl-generic-math/__signbit.c
@@ -0,0 +1,13 @@
+#include "libm.h"
+
+// FIXME: macro in math.h
+int __signbit(double x)
+{
+ union {
+ double d;
+ uint64_t i;
+ } y = { x };
+ return y.i>>63;
+}
+
+