From 7f4dfd005a8aa71afa703012ab613a3afc08785a Mon Sep 17 00:00:00 2001 From: MarcosPividori Date: Tue, 14 Jun 2016 11:44:18 -0300 Subject: [PATCH] Use absolute value when considering relative error. --- src/mlpack/tests/test_tools.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mlpack/tests/test_tools.hpp b/src/mlpack/tests/test_tools.hpp index 2d4e56e235..77fd1c189b 100644 --- a/src/mlpack/tests/test_tools.hpp +++ b/src/mlpack/tests/test_tools.hpp @@ -37,6 +37,6 @@ // Require the approximation L to be within a relative error of E respect to the // actual value R. #define REQUIRE_RELATIVE_ERR( L, R, E ) \ - BOOST_REQUIRE_LE( abs((R) - (L)), (E) * (R)) + BOOST_REQUIRE_LE( abs((R) - (L)), (E) * abs(R)) #endif