From c885a88817687aafcf56642b447cc59005f8e04f Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Mon, 21 Oct 2013 22:12:57 +0000 Subject: [PATCH] Use fully qualified names for isnan, isinf, and finite Specify the versions in the global namespace, to avoid ambiguity between these and the versions in namespace std that are available in C++11. --- src/base/checkFinite.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/base/checkFinite.cpp b/src/base/checkFinite.cpp index 77ca0b89a..4437382a6 100644 --- a/src/base/checkFinite.cpp +++ b/src/base/checkFinite.cpp @@ -44,10 +44,10 @@ void checkFinite(const double tmp) throw std::range_error("checkFinite()"); } #else - if (!finite(tmp)) { - if (isnan(tmp)) { + if (!::finite(tmp)) { + if (::isnan(tmp)) { printf("checkFinite() ERROR: we have encountered a nan!\n"); - } else if (isinf(tmp) == 1) { + } else if (::isinf(tmp) == 1) { printf("checkFinite() ERROR: we have encountered a pos inf!\n"); } else { printf("checkFinite() ERROR: we have encountered a neg inf!\n");