summaryrefslogtreecommitdiffstats
path: root/tests/EquationSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/EquationSystem.cpp')
-rw-r--r--tests/EquationSystem.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/EquationSystem.cpp b/tests/EquationSystem.cpp
index 6d83917..309e5f5 100644
--- a/tests/EquationSystem.cpp
+++ b/tests/EquationSystem.cpp
@@ -63,8 +63,8 @@ main()
<< "Iterations: " << integrator.iterations() << std::endl
<< "Rejections: " << integrator.rejections() << std::endl;
- double error = std::abs(expected - actual)/expected;
- if (error > 6.0e-7) {
+ double error = std::abs(expected - actual)/std::abs(expected);
+ if (error > 6.0e-7 || !std::isfinite(error)) {
std::cerr << "Error: " << 100.0*error << "%" << std::endl;
return EXIT_FAILURE;
} else {