cmake HAVE_FP_EXCEPTIONS examples

geodynamics/aspect cmake/fpe_check.cmake :24

check_cxx_source_runs("
#include <fenv.h>
#include <limits>
#include <sstream>

#include <deal.II/base/utilities.h>

int main()
{
  // Some implementations seem to not initialize the FPE bits to zero.
  // Make sure we start from a clean state
  feclearexcept(FE_DIVBYZERO|FE_INVALID);

  // Enable floating point exceptions
  feenableexcept(FE_DIVBYZERO|FE_INVALID);

  std::ostringstream description;
  const double lower_bound = -std::numeric_limits<double>::max();

  description << lower_bound;
  description << dealii::Utilities::string_to_int (\"1\");

  return 0;
}
" HAVE_FP_EXCEPTIONS)