# DEAL_II_WITH_CXX17
#
# DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE
-# DEAL_II_HAVE_ISNAN
-# DEAL_II_HAVE_UNDERSCORE_ISNAN
# DEAL_II_HAVE_ISFINITE
# DEAL_II_HAVE_FP_EXCEPTIONS
# DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS
"
DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE)
-CHECK_CXX_SOURCE_COMPILES(
- "
- #include <cmath>
- int main(){ double d=0; std::isnan (d); return 0; }
- "
- DEAL_II_HAVE_STD_ISNAN)
-
-
-CHECK_CXX_SOURCE_COMPILES(
- "
- #include <cmath>
- int main(){ double d=0; isnan (d); return 0; }
- "
- DEAL_II_HAVE_ISNAN)
-
-
-CHECK_CXX_SOURCE_COMPILES(
- "
- #include <cmath>
- int main(){ double d=0; _isnan (d); return 0; }
- "
- DEAL_II_HAVE_UNDERSCORE_ISNAN)
-
-
CHECK_CXX_SOURCE_COMPILES(
"
#include <cmath>
*/
#cmakedefine DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE
-#cmakedefine DEAL_II_HAVE_ISNAN
-#cmakedefine DEAL_II_HAVE_STD_ISNAN
-#cmakedefine DEAL_II_HAVE_UNDERSCORE_ISNAN
#cmakedefine DEAL_II_HAVE_ISFINITE
#cmakedefine DEAL_II_HAVE_FP_EXCEPTIONS
#cmakedefine DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS
*
* If none of the functions detecting NaN is available, this function
* returns false.
+ *
+ * @deprecated This function has been deprecated in favor of the C++11
+ * function <code>std::isnan</code>.
*/
- bool is_nan (const double x);
+ bool is_nan (const double x) DEAL_II_DEPRECATED;
/**
* Return @p true if the given value is a finite floating point number, i.e.
inline bool is_nan (const double x)
{
-#ifdef DEAL_II_HAVE_STD_ISNAN
return std::isnan(x);
-#elif defined(DEAL_II_HAVE_ISNAN)
- return isnan(x);
-#elif defined(DEAL_II_HAVE_UNDERSCORE_ISNAN)
- return _isnan(x);
-#else
- return false;
-#endif
}
inline bool is_finite (const double x)
{
#ifdef DEAL_II_HAVE_ISFINITE
- return !is_nan(x) && std::isfinite (x);
+ return !std::isnan(x) && std::isfinite (x);
#else
// Check against infinities. Note
// that if x is a NaN, then both
* procedure.
*
* The iteration is also aborted if the residual becomes a denormalized
- * value (@p NaN). Note, however, that this check is only performed if the
- * @p isnan function is provided by the operating system, which is not
- * always true. CMake checks this with the 'check_01_cxx_features.cmake'
- * test and sets the flag @p DEAL_II_HAVE_ISNAN in the include file
- * <tt>deal.II/base/config.h</tt> if this function was found.
+ * value (@p NaN).
*
* <tt>check()</tt> additionally preserves @p step and @p check_value. These
* values are accessible by <tt>last_value()</tt> and <tt>last_step()</tt>.
}
if ((step >= maxsteps) ||
- numbers::is_nan(check_value) ||
+ std::isnan(check_value) ||
(check_failure && (check_value > failure_residual))
)
{