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/isnan.c')
-rw-r--r--winsup/mingw/mingwex/math/isnan.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/math/isnan.c b/winsup/mingw/mingwex/math/isnan.c
new file mode 100644
index 000000000..b38bc290e
--- /dev/null
+++ b/winsup/mingw/mingwex/math/isnan.c
@@ -0,0 +1,14 @@
+#include <math.h>
+
+int
+__isnan (double _x)
+{
+ unsigned short _sw;
+ __asm__ ("fxam;"
+ "fstsw %%ax": "=a" (_sw) : "t" (_x));
+ return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
+ == FP_NAN;
+}
+
+#undef isnan
+int __attribute__ ((alias ("__isnan"))) isnan (double);