mirror of
https://github.com/google/benchmark.git
synced 2025-04-06 09:31:03 +08:00
Fix division by zero for low frequency timers for CV statistics (#1724)
This commit is contained in:
parent
7b52bf7346
commit
2d2e07e3c5
@ -84,6 +84,8 @@ double StatisticsCV(const std::vector<double>& v) {
|
||||
const auto stddev = StatisticsStdDev(v);
|
||||
const auto mean = StatisticsMean(v);
|
||||
|
||||
if (std::fpclassify(mean) == FP_ZERO) return 0.0;
|
||||
|
||||
return stddev / mean;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user