16 #ifndef dealii__numbers_h 17 #define dealii__numbers_h 20 #include <deal.II/base/config.h> 21 #include <deal.II/base/types.h> 27 DEAL_II_NAMESPACE_OPEN
49 static const double E = 2.7182818284590452354;
54 static const double LOG2E = 1.4426950408889634074;
59 static const double LOG10E = 0.43429448190325182765;
64 static const double LN2 = 0.69314718055994530942;
69 static const double LN10 = 2.30258509299404568402;
74 static const double PI = 3.14159265358979323846;
79 static const double PI_2 = 1.57079632679489661923;
84 static const double PI_4 = 0.78539816339744830962;
89 static const double SQRT2 = 1.41421356237309504880;
94 static const double SQRT1_2 = 0.70710678118654752440;
106 bool is_nan (
const double x);
123 bool is_finite (
const std::complex<double> &x);
129 bool is_finite (
const std::complex<float> &x);
139 bool is_finite (
const std::complex<long double> &x);
151 template <
typename number>
175 const number &
conjugate (
const number &x);
189 real_type
abs (
const number &x);
199 template <
typename number>
221 std::complex<number>
conjugate (
const std::complex<number> &x);
230 real_type
abs_square (
const std::complex<number> &x);
237 real_type
abs (
const std::complex<number> &x);
244 #ifdef DEAL_II_HAVE_STD_ISNAN 245 return std::isnan(x);
246 #elif defined(DEAL_II_HAVE_ISNAN) 248 #elif defined(DEAL_II_HAVE_UNDERSCORE_ISNAN) 257 #ifdef DEAL_II_HAVE_ISFINITE 258 return !
is_nan(x) && std::isfinite (x);
263 return ((x >= -std::numeric_limits<double>::max())
265 (x <= std::numeric_limits<double>::max()));
293 inline bool is_finite (
const std::complex<long double> &x)
302 template <
typename number>
311 template <
typename number>
320 template <
typename number>
329 template <
typename number>
338 template <
typename number>
347 template <
typename number>
351 return std::norm (x);
358 DEAL_II_NAMESPACE_CLOSE
static const number & conjugate(const number &x)
static const double SQRT2
static real_type abs(const number &x)
bool is_finite(const double x)
static real_type abs_square(const number &x)
static const bool is_complex
bool is_nan(const double x)
static const double LOG2E
static const double SQRT1_2
static const double LOG10E