From: wolf Date: Wed, 15 Mar 2006 20:57:26 +0000 (+0000) Subject: Implement is_finite X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29ee4c2dd68c2645fa42ff96826b4faa1e44a25d;p=dealii-svn.git Implement is_finite git-svn-id: https://svn.dealii.org/trunk@12605 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/source/config.cc b/deal.II/base/source/config.cc new file mode 100644 index 0000000000..4d8ec7b70e --- /dev/null +++ b/deal.II/base/source/config.cc @@ -0,0 +1,35 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2006 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//--------------------------------------------------------------------------- + + +#include +#include +#include + + +namespace deal_II_numbers +{ + bool is_finite (const double x) + { +#ifdef DEAL_II_HAVE_ISFINITE + return std::isfinite (x); +#else + // check against infinities. not + // that if x is a NaN, then both + // comparisons will be false + return ((x >= std::numeric_limits::min()) + && + (x <= std::numeric_limits::max())); +#endif + } +}