ssize_t min, max;
min = bucket_min(tally->min, tally->step_bits, b);
ssize_t min, max;
min = bucket_min(tally->min, tally->step_bits, b);
- if (b == tally->buckets - 1)
+ if (b == tally->buckets - 1) {
max = bucket_min(tally->min, tally->step_bits, b+1) - 1;
max = bucket_min(tally->min, tally->step_bits, b+1) - 1;
/* FIXME: Think harder about cumulative error; is this enough?. */
*err = (max - min + 1) / 2;
/* FIXME: Think harder about cumulative error; is this enough?. */
*err = (max - min + 1) / 2;