diff --git a/cpp/benchmarks/common/generate_input.hpp b/cpp/benchmarks/common/generate_input.hpp index 43fee5c50a7..5246de00a73 100644 --- a/cpp/benchmarks/common/generate_input.hpp +++ b/cpp/benchmarks/common/generate_input.hpp @@ -114,7 +114,8 @@ std::pair default_range() template ()>* = nullptr> std::pair default_range() { - return {std::numeric_limits::lowest(), std::numeric_limits::max()}; + // Limits need to be such that `upper - lower` does not overflow + return {std::numeric_limits::lowest() / 2, std::numeric_limits::max() / 2}; } } // namespace