Fixed bug in ChiSquareTest isNonNegative function that was incorrectly

rejecting 2-way tables with zero counts.
Fixes PR #32531
Reported by: Hans van der Heijden


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@141504 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Phil Steitz 2004-12-04 20:47:46 +00:00
parent 01c927d650
commit a39153784e
1 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ import org.apache.commons.math.distribution.ChiSquaredDistribution;
/**
* Implements Chi-Square test statistics defined in the {@link ChiSquareTest} interface.
*
* @version $Revision: 1.10 $ $Date: 2004/06/26 22:08:02 $
* @version $Revision: 1.11 $ $Date: 2004/12/04 20:47:46 $
*/
public class ChiSquareTestImpl implements ChiSquareTest {
@ -268,7 +268,7 @@ public class ChiSquareTestImpl implements ChiSquareTest {
private boolean isNonNegative(long[][] in) {
for (int i = 0; i < in.length; i ++) {
for (int j = 0; j < in[i].length; j++) {
if (in[i][j] <= 0) {
if (in[i][j] < 0) {
return false;
}
}