Skip to content

Commit

Permalink
Static cast to avoid conversion warning
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenarnst committed May 24, 2024
1 parent b086a63 commit d3990ce
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/benchmark_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,7 @@ double BenchmarkRunner::GetMinTimeToApply() const {
}

double BenchmarkRunner::GetRelAccuracy(const IterationResults& i) const {
return std::sqrt(i.seconds_pow2 / i.iters -
std::pow(i.seconds / i.iters, 2.)) /
(i.seconds / i.iters) / sqrt(i.iters);
return std::sqrt(i.seconds_pow2 - std::pow(i.seconds, 2.) / static_cast<double>(i.iters)) / i.seconds;
}

bool BenchmarkRunner::HasSufficientTimeToApply(
Expand Down

0 comments on commit d3990ce

Please sign in to comment.