In GammaTest: restored method checkRelativeError which was inadvertently removed in r1414527.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1414531 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastien Brisard 2012-11-28 05:39:39 +00:00
parent 87d61c2a51
commit a869a06efa
1 changed files with 6 additions and 1 deletions

View File

@ -19,7 +19,6 @@ package org.apache.commons.math3.special;
import org.apache.commons.math3.TestUtils;
import org.apache.commons.math3.exception.NumberIsTooLargeException;
import org.apache.commons.math3.exception.NumberIsTooSmallException;
import org.apache.commons.math3.exception.OutOfRangeException;
import org.apache.commons.math3.util.FastMath;
import org.junit.Assert;
import org.junit.Test;
@ -961,4 +960,10 @@ public class GammaTest {
Assert.assertTrue(Integer.toString(i), Double.isNaN(Gamma.gamma(i)));
}
}
private void checkRelativeError(String msg, double expected, double actual,
double tolerance) {
Assert.assertEquals(msg, expected, actual, FastMath.abs(tolerance * actual));
}
}