OGS
DisableFPE.h
Go to the documentation of this file.
1
11#if !defined(_WIN32) && !defined(__APPLE__)
12#include <cfenv>
13
15{
16public:
18 {
19 fegetenv(&fe_env); // Store floating-point exception handling.
20 fesetenv(FE_DFL_ENV); // Set default environment effectively disabling
21 // exceptions.
22 }
23
25 {
26 fesetenv(&fe_env); // Restore floating-point exception handling.
27 }
28
29private:
30 fenv_t fe_env;
31};
32
33#else
34
35// No-op for Windows and Apple
36class DisableFPE
37{
38};
39
40#endif
fenv_t fe_env
Definition DisableFPE.h:30