From 07530dbbeb25b89b9fbaaea2c9823d5ea157a038 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 5 Sep 2017 14:55:43 -0700 Subject: Fixup bounds --- tools/codegen/core/gen_stats_data.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/codegen/core/gen_stats_data.py') diff --git a/tools/codegen/core/gen_stats_data.py b/tools/codegen/core/gen_stats_data.py index 104ac83f17..60cbd6436f 100755 --- a/tools/codegen/core/gen_stats_data.py +++ b/tools/codegen/core/gen_stats_data.py @@ -110,12 +110,12 @@ def gen_bucket_code(histogram): done_unmapped = False first_nontrivial = None first_unmapped = None - while len(bounds) < histogram.buckets: - if len(bounds) == histogram.buckets - 1: + while len(bounds) < histogram.buckets + 1: + if len(bounds) == histogram.buckets: nextb = int(histogram.max) else: mul = math.pow(float(histogram.max) / bounds[-1], - 1.0 / (histogram.buckets - len(bounds))) + 1.0 / (histogram.buckets + 1 - len(bounds))) nextb = int(math.ceil(bounds[-1] * mul)) if nextb <= bounds[-1] + 1: nextb = bounds[-1] + 1 -- cgit v1.2.3