diff options
author | eschnett <eschnett@105869f7-3296-0410-a4ea-f4349344b45a> | 2012-08-02 20:40:29 +0000 |
---|---|---|
committer | eschnett <eschnett@105869f7-3296-0410-a4ea-f4349344b45a> | 2012-08-02 20:40:29 +0000 |
commit | 95156e0c84a5e3282b27aafce4199f77a2fecf14 (patch) | |
tree | 9aea009871b0237eaedeb7b1bd99c945a506058d | |
parent | c182e60db8109bd452dc2b67d491ec7a0e68c9d3 (diff) |
Wrap isnan calls to avoid C++ namespace issues
git-svn-id: https://svn.cct.lsu.edu/repos/numrel/LSUThorns/Vectors/trunk@61 105869f7-3296-0410-a4ea-f4349344b45a
-rw-r--r-- | src/test.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/test.cc b/src/test.cc index d2c7e58..924e4ec 100644 --- a/src/test.cc +++ b/src/test.cc @@ -11,10 +11,14 @@ using namespace std; +inline int my_isnan (CCTK_REAL const x) +{ + return std::isnan(x); +} + inline int my_signbit (CCTK_REAL const x) { - using namespace std; - return signbit(x); + return std::signbit(x); } #define SCALARTEST(testname, vecexpr, scalarexpr) \ @@ -26,7 +30,9 @@ inline int my_signbit (CCTK_REAL const x) CCTK_REAL const vecres = (vecexpr); \ CCTK_REAL const eps = numeric_limits<CCTK_REAL>::epsilon(); \ assert(abs((CCTK_REAL)0.1) > 0); \ - if ((abs(vecres - res) <= 10*eps) or (isnan(vecres) and isnan(res))) { \ + if ((abs(vecres - res) <= 10*eps) or \ + (my_isnan(vecres) and my_isnan(res))) \ + { \ passed++; \ } else { \ CCTK_VParamWarn(CCTK_THORNSTRING, \ @@ -47,7 +53,9 @@ inline int my_signbit (CCTK_REAL const x) CCTK_REAL vecres = vec_elt(rv,i); \ CCTK_REAL eps = numeric_limits<CCTK_REAL>::epsilon(); \ assert(abs((CCTK_REAL)0.1) > 0); \ - if ((abs(vecres - res) <= 10*eps) or (isnan(vecres) and isnan(res))) { \ + if ((abs(vecres - res) <= 10*eps) or \ + (my_isnan(vecres) and my_isnan(res))) \ + { \ passed++; \ } else { \ CCTK_VParamWarn(CCTK_THORNSTRING, \ |