commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1292741 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/TriangularDistribution.java
Date Thu, 23 Feb 2012 11:26:36 GMT
Author: erans
Date: Thu Feb 23 11:26:36 2012
New Revision: 1292741

URL: http://svn.apache.org/viewvc?rev=1292741&view=rev
Log:
Changed branching, such that the code complies with the definition
referred to in the doc. [Spotted by D. Hendriks.]

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/TriangularDistribution.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/TriangularDistribution.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/TriangularDistribution.java?rev=1292741&r1=1292740&r2=1292741&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/TriangularDistribution.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/TriangularDistribution.java
Thu Feb 23 11:26:36 2012
@@ -260,7 +260,7 @@ public class TriangularDistribution exte
         if (p == 1) {
             return b;
         }
-        if (p <= (c - a) / (b - a)) {
+        if (p < (c - a) / (b - a)) {
             return a + FastMath.sqrt(p * (b - a) * (c - a));
         }
         return b - FastMath.sqrt((1 - p) * (b - a) * (b - c));



Mime
View raw message