avoid ArrayOutOfBoundsException
git-svn-id: http://google-refine.googlecode.com/svn/trunk@484 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
397861b612
commit
1e5a787281
@ -162,7 +162,7 @@ public class NumericBinIndex {
|
|||||||
|
|
||||||
_bins = new int[(int) Math.round(binCount)];
|
_bins = new int[(int) Math.round(binCount)];
|
||||||
for (double d : allValues) {
|
for (double d : allValues) {
|
||||||
int bin = (int) Math.floor((d - _min) / _step);
|
int bin = Math.max((int) Math.floor((d - _min) / _step),0);
|
||||||
_bins[bin]++;
|
_bins[bin]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user