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.
This commit is contained in:
Ray Speth 2013-10-21 22:12:57 +00:00
parent 94f1b35b79
commit c885a88817

View file

@ -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");