You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2016/01/02 20:07:11 UTC
[11/14] [math] Enlarged test tolerance as test did not pass with Java
5.
Enlarged test tolerance as test did not pass with Java 5.
Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/775bde7a
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/775bde7a
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/775bde7a
Branch: refs/heads/3.6-release
Commit: 775bde7a4df691bd5890475d0398a31411508f81
Parents: e206688
Author: Luc Maisonobe <lu...@apache.org>
Authored: Sat Jan 2 19:46:33 2016 +0100
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Sat Jan 2 19:46:33 2016 +0100
----------------------------------------------------------------------
.../math3/distribution/EnumeratedIntegerDistributionTest.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-math/blob/775bde7a/src/test/java/org/apache/commons/math3/distribution/EnumeratedIntegerDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/distribution/EnumeratedIntegerDistributionTest.java b/src/test/java/org/apache/commons/math3/distribution/EnumeratedIntegerDistributionTest.java
index 85aa5af..4277187 100644
--- a/src/test/java/org/apache/commons/math3/distribution/EnumeratedIntegerDistributionTest.java
+++ b/src/test/java/org/apache/commons/math3/distribution/EnumeratedIntegerDistributionTest.java
@@ -22,6 +22,7 @@ import org.apache.commons.math3.exception.NotANumberException;
import org.apache.commons.math3.exception.NotFiniteNumberException;
import org.apache.commons.math3.exception.NotPositiveException;
import org.apache.commons.math3.util.FastMath;
+import org.apache.commons.math3.util.Precision;
import org.junit.Assert;
import org.junit.Test;
@@ -173,7 +174,7 @@ public class EnumeratedIntegerDistributionTest {
public void testCreateFromIntegers() {
final int[] data = new int[] {0, 1, 1, 2, 2, 2};
EnumeratedIntegerDistribution distribution = new EnumeratedIntegerDistribution(data);
- Assert.assertEquals(0.5, distribution.probability(2), 0);
- Assert.assertEquals(0.5, distribution.cumulativeProbability(1), 0);
+ Assert.assertEquals(0.5, distribution.probability(2), Precision.EPSILON);
+ Assert.assertEquals(0.5, distribution.cumulativeProbability(1), Precision.EPSILON);
}
}