Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libm/common/s_signbit.c')
-rw-r--r--newlib/libm/common/s_signbit.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/newlib/libm/common/s_signbit.c b/newlib/libm/common/s_signbit.c
new file mode 100644
index 000000000..d7d49cbb1
--- /dev/null
+++ b/newlib/libm/common/s_signbit.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+#include "fdlibm.h"
+
+int __signbitf (float x);
+int __signbitd (double x);
+
+int
+__signbitf (float x)
+{
+ unsigned int w;
+
+ GET_FLOAT_WORD(w,x);
+
+ return (w & 0x80000000);
+}
+
+int
+__signbitd (double x)
+{
+ unsigned int msw;
+
+ GET_HIGH_WORD(msw, x);
+
+ return (msw & 0x80000000);
+}