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 'winsup/mingw/mingwex/math/logb.c')
-rw-r--r--winsup/mingw/mingwex/math/logb.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/math/logb.c b/winsup/mingw/mingwex/math/logb.c
new file mode 100644
index 000000000..cdff13647
--- /dev/null
+++ b/winsup/mingw/mingwex/math/logb.c
@@ -0,0 +1,16 @@
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Changes for long double by Ulrich Drepper <drepper@cygnus.com>
+ * Public domain.
+ */
+
+#include <math.h>
+
+double
+logb (double x)
+{
+ double res;
+ asm ("fxtract\n\t"
+ "fstp %%st" : "=t" (res) : "0" (x));
+ return res;
+}