summaryrefslogtreecommitdiffstats
path: root/tests/HE12.cpp
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-06-10 01:05:23 -0600
committerTavian Barnes <tavianator@gmail.com>2011-06-10 01:05:23 -0600
commitd03ab99aa999544403652e0739c9bea3b8b7835e (patch)
tree6a470b04590652a6624e36771ff89894f9a761b1 /tests/HE12.cpp
parentd4560540b80ac1a05c86812c51119ed08f01de9d (diff)
downloadvz-d03ab99aa999544403652e0739c9bea3b8b7835e.tar.xz
Test for NaNs in results.
Diffstat (limited to 'tests/HE12.cpp')
-rw-r--r--tests/HE12.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/HE12.cpp b/tests/HE12.cpp
index 19c5e59..8de11e8 100644
--- a/tests/HE12.cpp
+++ b/tests/HE12.cpp
@@ -51,8 +51,8 @@ main()
<< "Iterations: " << integrator.iterations() << std::endl
<< "Rejections: " << integrator.rejections() << std::endl;
- double error = std::abs(expected - actual)/expected;
- if (error > 8.7e-7) {
+ double error = std::abs(expected - actual)/std::abs(expected);
+ if (error > 8.7e-7 || !std::isfinite(error)) {
std::cerr << "Error: " << 100.0*error << "%" << std::endl;
return EXIT_FAILURE;
} else {