summaryrefslogtreecommitdiff
path: root/src/fenv/feupdateenv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fenv/feupdateenv.c')
-rw-r--r--src/fenv/feupdateenv.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/fenv/feupdateenv.c b/src/fenv/feupdateenv.c
new file mode 100644
index 00000000..50cef8e5
--- /dev/null
+++ b/src/fenv/feupdateenv.c
@@ -0,0 +1,9 @@
+#include <fenv.h>
+
+int feupdateenv(const fenv_t *envp)
+{
+ int ex = fetestexcept(FE_ALL_EXCEPT);
+ fesetenv(envp);
+ feraiseexcept(ex);
+ return 0;
+}