diff options
Diffstat (limited to 'tests/Heun.cpp')
-rw-r--r-- | tests/Heun.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/Heun.cpp b/tests/Heun.cpp index d4f02bc..6eca969 100644 --- a/tests/Heun.cpp +++ b/tests/Heun.cpp @@ -48,8 +48,8 @@ main() << "Expected: " << expected << std::endl << "Iterations: " << integrator.iterations() << std::endl; - double error = std::abs(expected - actual)/expected; - if (error > 1.4e-4) { + double error = std::abs(expected - actual)/std::abs(expected); + if (error > 1.4e-4 || !std::isfinite(error)) { std::cerr << "Error: " << 100.0*error << "%" << std::endl; return EXIT_FAILURE; } else { |