Use MathUtils.PI_SQUARED.

This commit is contained in:
Thomas Neidhart 2014-10-06 22:50:20 +02:00
parent 026af89ceb
commit cde43197f9
2 changed files with 4 additions and 2 deletions

View File

@ -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} */

View File

@ -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} */