Commit 2aaa8b01 authored by Brian White's avatar Brian White Committed by Commit Bot

Check log() operation on current value.

Bug: 836238
Change-Id: I10a60aea6e70c0a0f4a0ed40a7c9172ae383d170
Reviewed-on: https://chromium-review.googlesource.com/c/1334294Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Brian White <bcwhite@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607802}
parent f9ec4cb0
......@@ -430,10 +430,13 @@ void Histogram::InitializeBucketRanges(Sample minimum,
debug::Alias(&maximum);
debug::Alias(&bucket_count);
debug::Alias(&checksum);
debug::Alias(&current);
while (bucket_count > ++bucket_index) {
double log_current;
log_current = log(static_cast<double>(current));
CHECK_EQ(current, static_cast<Sample>(std::round(exp(log_current))));
debug::Alias(&log_current);
// Calculate the count'th root of the range.
log_ratio = (log_max - log_current) / (bucket_count - bucket_index);
// See where the next bucket would start.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment