about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fenv/__flt_rounds.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/fenv/__flt_rounds.c b/src/fenv/__flt_rounds.c
new file mode 100644
index 00000000..ec0b3689
--- /dev/null
+++ b/src/fenv/__flt_rounds.c
@@ -0,0 +1,19 @@
+#include <float.h>
+#include <fenv.h>
+
+int __flt_rounds()
+{
+	switch (fegetround()) {
+#ifdef FE_TOWARDZERO
+	case FE_TOWARDZERO: return 0;
+#endif
+	case FE_TONEAREST: return 1;
+#ifdef FE_UPWARD
+	case FE_UPWARD: return 2;
+#endif
+#ifdef FE_DOWNWARD
+	case FE_DOWNWARD: return 3;
+#endif
+	}
+	return -1;
+}