diff --git a/src/java/org/apache/commons/math/stat/univariate/summary/SumOfLogs.java b/src/java/org/apache/commons/math/stat/univariate/summary/SumOfLogs.java index 051eaf6c3..bc96a8781 100644 --- a/src/java/org/apache/commons/math/stat/univariate/summary/SumOfLogs.java +++ b/src/java/org/apache/commons/math/stat/univariate/summary/SumOfLogs.java @@ -17,45 +17,41 @@ package org.apache.commons.math.stat.univariate.summary; import java.io.Serializable; -import org - .apache - .commons - .math - .stat - .univariate - .AbstractStorelessUnivariateStatistic; +import org.apache.commons.math.stat.univariate.AbstractStorelessUnivariateStatistic; /** - * Returns the sum of the natural logs for this collection of values. + * Returns the sum of the natural logs for this collection of values. + *
+ * Uses {@link java.lang.Math#log(double)} to compute the logs. Therefore, + *
NaN.
Double.POSITIVE_INFINITY
,
+ * but at least one value is 0, the result is Double.NEGATIVE_INFINITY.
Double.POSITIVE_INFINITY
and
+ * Double.NEGATIVE_INFINITY
are among the values, the result is
+ * NaN.
+ * See {@link SumOfLogs}. + * * @param values Is a double[] containing the values * @param begin processing at this point in the array * @param length the number of elements to include * @return the sumLog value or Double.NaN if the array is empty * @see org.apache.commons.math.stat.univariate.UnivariateStatistic#evaluate(double[], int, int) */ - public double evaluate( - final double[] values, - final int begin, - final int length) { + public double evaluate(final double[] values, final int begin, final int length) { double sumLog = Double.NaN; if (test(values, begin, length)) { sumLog = 0.0;