MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / setFPExcept

Function setFPExcept

Src/Base/AMReX.cpp:1052–1067  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1050}
1051
1052FPExcept setFPExcept (FPExcept excepts)
1053{
1054 auto prev = getFPExcept();
1055#if defined(__linux__) && defined(__GLIBC__)
1056 int flags = FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW;
1057 fedisableexcept(flags);
1058 flags = 0;
1059 if (any(excepts & FPExcept::invalid )) { flags |= FE_INVALID ; }
1060 if (any(excepts & FPExcept::zero )) { flags |= FE_DIVBYZERO; }
1061 if (any(excepts & FPExcept::overflow)) { flags |= FE_OVERFLOW ; }
1062 feenableexcept(flags);
1063#else
1064 amrex::ignore_unused(excepts);
1065#endif
1066 return prev;
1067}
1068
1069FPExcept disableFPExcept (FPExcept excepts)
1070{

Callers

nothing calls this directly

Calls 2

getFPExceptFunction · 0.85
anyFunction · 0.85

Tested by

no test coverage detected