diff options
| author | Joe Noël | 2022-06-06 15:36:22 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-06-07 00:27:37 +0200 |
| commit | d0177ee68607e7298869807bfcd20c080512185f (patch) | |
| tree | 64200149a23a5072f412c8955b94e7f7b3bd9e74 | |
| parent | 173539ab9e504816f3142c4566827bd670f38a07 (diff) | |
| download | catch3-d0177ee68607e7298869807bfcd20c080512185f.tar.gz | |
Fix implicit long to double conversion
Raises a compiler warning when compiled with `-Wimplicit-int-float-conversion` using clang.
| -rw-r--r-- | src/catch2/benchmark/detail/catch_stats.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/catch2/benchmark/detail/catch_stats.hpp b/src/catch2/benchmark/detail/catch_stats.hpp index db93fa29..bfeace2c 100644 --- a/src/catch2/benchmark/detail/catch_stats.hpp +++ b/src/catch2/benchmark/detail/catch_stats.hpp @@ -115,7 +115,7 @@ namespace Catch { double z1 = normal_quantile((1. - confidence_level) / 2.); auto cumn = [n]( double x ) -> long { - return std::lround( normal_cdf( x ) * n ); + return std::lround( normal_cdf( x ) * static_cast<double>(n) ); }; auto a = [bias, accel](double b) { return bias + b / (1. - accel * b); }; double b1 = bias + z1; |