ReFRACtor
fe_disable_exception.h
Go to the documentation of this file.
1 #ifndef FE_DISABLE_EXCEPTION_H
2 #define FE_DISABLE_EXCEPTION_H
3 #include <fenv.h>
4 
5 namespace FullPhysics {
6 /****************************************************************/
22 public:
24  {
25  // Mac doesn't have this function, even though it is a C99
26  // function. We check for this during configuration.
27 #ifdef HAVE_FEENABLEEXCEPT
28  fegetexceptflag(&initial_flag, FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
29  initial_trap = fedisableexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
30 #endif
31  }
33  {
34 #ifdef HAVE_FEENABLEEXCEPT
35  feclearexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
36  fesetexceptflag(&initial_flag, FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
37  feenableexcept(initial_trap);
38 #endif
39  }
40 private:
41  fexcept_t initial_flag;
42  int initial_trap;
43 };
44 
45 }
46 #endif
To detect things like divide by zero, we may turn on floating point exceptions.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:11