You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by sc...@apache.org on 2019/09/16 12:51:36 UTC

[commons-math] branch fix-test created (now ae452dd)

This is an automated email from the ASF dual-hosted git repository.

scolebourne pushed a change to branch fix-test
in repository https://gitbox.apache.org/repos/asf/commons-math.git.


      at ae452dd  Provide leniency in test case

This branch includes the following new commits:

     new ae452dd  Provide leniency in test case

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[commons-math] 01/01: Provide leniency in test case

Posted by sc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

scolebourne pushed a commit to branch fix-test
in repository https://gitbox.apache.org/repos/asf/commons-math.git

commit ae452dd8bc48eaf4fc7246562039d29c19168dd7
Author: Stephen Colebourne <sc...@joda.org>
AuthorDate: Mon Sep 16 13:48:44 2019 +0100

    Provide leniency in test case
    
    Test previously failed with 0.5 compared to 0.5000000000000001
---
 .../commons/math3/distribution/EnumeratedRealDistributionTest.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/commons/math3/distribution/EnumeratedRealDistributionTest.java b/src/test/java/org/apache/commons/math3/distribution/EnumeratedRealDistributionTest.java
index e9155fe..0ca5039 100644
--- a/src/test/java/org/apache/commons/math3/distribution/EnumeratedRealDistributionTest.java
+++ b/src/test/java/org/apache/commons/math3/distribution/EnumeratedRealDistributionTest.java
@@ -261,7 +261,7 @@ public class EnumeratedRealDistributionTest {
     public void testCreateFromDoubles() {
         final double[] data = new double[] {0, 1, 1, 2, 2, 2};
         EnumeratedRealDistribution distribution = new EnumeratedRealDistribution(data);
-        assertEquals(0.5, distribution.probability(2), 0);
+        assertEquals(0.5, distribution.probability(2), 1e-12);
         assertEquals(0.5, distribution.cumulativeProbability(1), 0);
     }
 }