diff --git a/benchmark/bench_framework.hpp b/benchmark/bench_framework.hpp index 0dfb76e8d..c5f280207 100644 --- a/benchmark/bench_framework.hpp +++ b/benchmark/bench_framework.hpp @@ -10,7 +10,7 @@ // stl #include -#include // log10 +#include // log10, round #include // snprintf #include #include @@ -153,7 +153,7 @@ struct big_number_fmt static const char* suffixes = "\0\0k\0M\0G\0T\0P\0E\0Z\0Y\0\0"; u = suffixes; - while (v > 1 && std::log10(v) >= width && u[2]) + while (v > 1 && std::log10(std::round(v)) >= width && u[2]) { v /= base; u += 2;