Anmol created MATH-1296:
---------------------------
Summary: DescriptiveStatistics return geometric mean as 0 when
product of values is zero, expected to return NaN
Key: MATH-1296
URL: https://issues.apache.org/jira/browse/MATH-1296
Project: Commons Math
Issue Type: Bug
Affects Versions: 3.4.1
Reporter: Anmol
Priority: Trivial
@Test
public void test() {
DescriptiveStatistics stats = new DescriptiveStatistics();
stats.addValue(1);
stats.addValue(2);
stats.addValue(4);
System.out.println(stats.getGeometricMean()); //prints 2
stats.addValue(0);
System.out.println(stats.getGeometricMean()); //prints 0,
expected NaN as per the documentation
}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)