MATH-292 TestUtils.assertRelativelyEquals() generates misleading error on failure

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@812871 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2009-09-09 10:11:15 +00:00
parent aa91ffbe33
commit 3c6d5dff6e
1 changed files with 2 additions and 2 deletions

View File

@ -169,8 +169,8 @@ public class TestUtils {
} else if (expected == 0.0) {
Assert.assertEquals(msg, actual, expected, relativeError);
} else {
double x = Math.abs((expected - actual) / expected);
Assert.assertEquals(msg, 0.0, x, relativeError);
double absError = Math.abs(expected) * relativeError;
Assert.assertEquals(msg, expected, actual, absError);
}
}