commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject [1/2] git commit: Use MathUtils.PI_SQUARED.
Date Mon, 06 Oct 2014 21:09:06 GMT
Repository: commons-math
Updated Branches:
  refs/heads/master 530ffe995 -> cee04d164


Use MathUtils.PI_SQUARED.


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/cde43197
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/cde43197
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/cde43197

Branch: refs/heads/master
Commit: cde43197f980538e411d851735ac7a63ddd613e1
Parents: 026af89
Author: Thomas Neidhart <thomas.neidhart@gmail.com>
Authored: Mon Oct 6 22:50:20 2014 +0200
Committer: Thomas Neidhart <thomas.neidhart@gmail.com>
Committed: Mon Oct 6 22:50:20 2014 +0200

----------------------------------------------------------------------
 .../org/apache/commons/math3/distribution/GumbelDistribution.java | 3 ++-
 .../apache/commons/math3/distribution/LogisticDistribution.java   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/cde43197/src/main/java/org/apache/commons/math3/distribution/GumbelDistribution.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/distribution/GumbelDistribution.java b/src/main/java/org/apache/commons/math3/distribution/GumbelDistribution.java
index ae4d842..f42a1e8 100644
--- a/src/main/java/org/apache/commons/math3/distribution/GumbelDistribution.java
+++ b/src/main/java/org/apache/commons/math3/distribution/GumbelDistribution.java
@@ -22,6 +22,7 @@ import org.apache.commons.math3.exception.util.LocalizedFormats;
 import org.apache.commons.math3.random.RandomGenerator;
 import org.apache.commons.math3.random.Well19937c;
 import org.apache.commons.math3.util.FastMath;
+import org.apache.commons.math3.util.MathUtils;
 
 /**
  * This class implements the Gumbel distribution.
@@ -127,7 +128,7 @@ public class GumbelDistribution extends AbstractRealDistribution {
 
     /** {@inheritDoc} */
     public double getNumericalVariance() {
-        return (FastMath.PI * FastMath.PI) / 6.0 * (beta * beta);
+        return (MathUtils.PI_SQUARED) / 6.0 * (beta * beta);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/commons-math/blob/cde43197/src/main/java/org/apache/commons/math3/distribution/LogisticDistribution.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/distribution/LogisticDistribution.java
b/src/main/java/org/apache/commons/math3/distribution/LogisticDistribution.java
index 402b582..7305594 100644
--- a/src/main/java/org/apache/commons/math3/distribution/LogisticDistribution.java
+++ b/src/main/java/org/apache/commons/math3/distribution/LogisticDistribution.java
@@ -22,6 +22,7 @@ import org.apache.commons.math3.exception.util.LocalizedFormats;
 import org.apache.commons.math3.random.RandomGenerator;
 import org.apache.commons.math3.random.Well19937c;
 import org.apache.commons.math3.util.FastMath;
+import org.apache.commons.math3.util.MathUtils;
 
 /**
  * This class implements the Logistic distribution.
@@ -121,7 +122,7 @@ public class LogisticDistribution extends AbstractRealDistribution {
 
     /** {@inheritDoc} */
     public double getNumericalVariance() {
-        return (FastMath.PI * FastMath.PI / 3.0) * (1.0 / (s * s));
+        return (MathUtils.PI_SQUARED / 3.0) * (1.0 / (s * s));
     }
 
     /** {@inheritDoc} */


Mime
View raw message