Skip to content

Commit 2d2e8f9

Browse files
committed
Merge branch 'develop' into IM-695-Read-custom-property-value-as-JSON
2 parents 5169ce9 + 2ce1cf4 commit 2d2e8f9

File tree

1 file changed

+2
-1
lines changed
  • api/org.integratedmodelling.klab.api/src/org/integratedmodelling/klab/rest

1 file changed

+2
-1
lines changed

api/org.integratedmodelling.klab.api/src/org/integratedmodelling/klab/rest/Histogram.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ private Builder(double min, double max, int bins) {
5656

5757
public void add(double d) {
5858
if (!degenerate) {
59-
bins[(int) ((d - min) / (max - min) * (bins.length - 1))]++;
59+
int size = bins.length - 1;
60+
bins[(int) Math.min(Math.ceil((d - min) / (max - min) * size), size)]++;
6061
}
6162
}
6263

0 commit comments

Comments
 (0)