first commit of the new libm!
[musl] / src / math / __signbitl.c
diff --git a/src/math/__signbitl.c b/src/math/__signbitl.c
new file mode 100644 (file)
index 0000000..81adb6c
--- /dev/null
@@ -0,0 +1,11 @@
+#include "libm.h"
+
+// FIXME: should be a macro
+#if (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
+int __signbitl(long double x)
+{
+       union ldshape u = {x};
+
+       return u.bits.sign;
+}
+#endif