#include <list>
#include <sstream>
#include <cctype>
+#include <limits>
-#ifdef HAVE_STD_NUMERIC_LIMITS
-# include <limits>
-#endif
#ifdef DEAL_II_MSVC
// on Windows systems with MS Visual C/C++, there is a
- const int Integer::min_int_value =
-#ifdef HAVE_STD_NUMERIC_LIMITS
- std::numeric_limits<int>::min();
-#else
- 1;
-#endif
-
- const int Integer::max_int_value =
-#ifdef HAVE_STD_NUMERIC_LIMITS
- std::numeric_limits<int>::max();
-#else
- 0;
-#endif
-
+ const int Integer::min_int_value = std::numeric_limits<int>::min();
+ const int Integer::max_int_value = std::numeric_limits<int>::max();
const char* Integer::description_init = "[Integer";
- const double Double::min_double_value =
-#ifdef HAVE_STD_NUMERIC_LIMITS
- -std::numeric_limits<double>::max();
-#else
- 1;
-#endif
-
- const double Double::max_double_value =
-#ifdef HAVE_STD_NUMERIC_LIMITS
- std::numeric_limits<double>::max();
-#else
- 0;
-#endif
+ const double Double::min_double_value = -std::numeric_limits<double>::max();
+ const double Double::max_double_value = std::numeric_limits<double>::max();
const char* Double::description_init = "[Double";
- const unsigned int List::max_int_value =
-#ifdef HAVE_STD_NUMERIC_LIMITS
- std::numeric_limits<unsigned int>::max();
-#else
- numbers::invalid_unsigned_int;
-#endif
-
+ const unsigned int List::max_int_value
+ = std::numeric_limits<unsigned int>::max();
const char* List::description_init = "[List";
- const unsigned int Map::max_int_value =
-#ifdef HAVE_STD_NUMERIC_LIMITS
- std::numeric_limits<unsigned int>::max();
-#else
- numbers::invalid_unsigned_int;
-#endif
-
+ const unsigned int Map::max_int_value
+ = std::numeric_limits<unsigned int>::max();
const char* Map::description_init = "[Map";
#include <deal.II/base/thread_management.h>
#include <cmath>
-#ifdef HAVE_STD_NUMERIC_LIMITS
-# include <limits>
-#endif
+#include <limits>
DEAL_II_NAMESPACE_OPEN
}
// check for underflow and overflow
-#ifdef HAVE_STD_NUMERIC_LIMITS
Assert (std::fabs(tmp_lagrange_weight) > std::numeric_limits<number>::min(),
ExcMessage ("Underflow in computation of Lagrange denominator."));
Assert (std::fabs(tmp_lagrange_weight) < std::numeric_limits<number>::max(),
ExcMessage ("Overflow in computation of Lagrange denominator."));
-#endif
+
lagrange_weight = static_cast<number>(1.)/tmp_lagrange_weight;
}
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/geometry_info.h>
-#include <cmath>
-#ifdef HAVE_STD_NUMERIC_LIMITS
-# include <limits>
-#endif
+#include <cmath>
+#include <limits>
DEAL_II_NAMESPACE_OPEN
// emulator only supports 64 bit
// arithmetic, even for 80 bit long
// doubles.
-#ifdef HAVE_STD_NUMERIC_LIMITS
const long double
long_double_eps = static_cast<long double>(std::numeric_limits<long double>::epsilon()),
double_eps = static_cast<long double>(std::numeric_limits<double>::epsilon());
-#else
- const long double
- long_double_eps = 1.09-19L,
- double_eps = 2.23-16;
-#endif
// now check whether long double is more
// accurate than double, and set
// Set tolerance. See class QGauss
// for detailed explanation.
-#ifdef HAVE_STD_NUMERIC_LIMITS
const long double
long_double_eps = static_cast<long double>(std::numeric_limits<long double>::epsilon()),
double_eps = static_cast<long double>(std::numeric_limits<double>::epsilon());
-#else
- const long double
- long_double_eps = 1.09-19L,
- double_eps = 2.23-16;
-#endif
// check whether long double is
// more accurate than double, and
#include <sys/types.h>
#include <sstream>
#include <iostream>
-
-#ifdef HAVE_STD_NUMERIC_LIMITS
-# include <limits>
-#else
-# include <limits.h>
-#endif
-
+#include <limits>
#ifdef DEAL_II_USE_TRILINOS
# ifdef DEAL_II_COMPILER_SUPPORTS_MPI
{
std::istringstream ss(s);
-#ifdef HAVE_STD_NUMERIC_LIMITS
- static const int max_int = std::numeric_limits<int>::max();
-#else
- static const int max_int = INT_MAX;
-#endif
-
- int i = max_int;
+ int i = std::numeric_limits<int>::max();
ss >> i;
// check for errors
- AssertThrow (i != max_int, ExcCantConvertString (s));
+ AssertThrow (i != std::numeric_limits<int>::max(),
+ ExcCantConvertString (s));
//TODO: The test for errors above doesn't work, as can easily be
//verified. furthermore, it doesn't catch cases like when calling
{
std::istringstream ss(s);
-#ifdef HAVE_STD_NUMERIC_LIMITS
- static const double max_double = std::numeric_limits<double>::max();
-#else
- static const double max_double = DBL_MAX;
-#endif
-
- double i = max_double;
+ double i = std::numeric_limits<double>::max();
ss >> i;
// check for errors
- AssertThrow (i != max_double, ExcCantConvertString (s));
+ AssertThrow (i != std::numeric_limits<double>::max(),
+ ExcCantConvertString (s));
//TODO: The test for errors above doesn't work, as can easily be
//verified. furthermore, it doesn't catch cases like when calling