diff --git a/subproject/test/source/verify_log_computation.cpp b/subproject/test/source/verify_log_computation.cpp index fbe9332..582d7a5 100644 --- a/subproject/test/source/verify_log_computation.cpp +++ b/subproject/test/source/verify_log_computation.cpp @@ -151,25 +151,27 @@ static verify_result verify(std::string_view name, std::size_t tier, using intermediate_type = decltype(info::multiply); using return_type = typename info::default_return_type; - constexpr auto max_intermediate_value = - std::min(std::numeric_limits::max(), - (std::min(static_cast(std::numeric_limits::max()), - std::numeric_limits::max() >> info::shift) - << info::shift) + - ((intermediate_type(1) << info::shift) - 1)); + constexpr auto max_intermediate_value = std::min( + std::numeric_limits::max(), + intermediate_type( + (std::min(static_cast(std::numeric_limits::max()), + intermediate_type(std::numeric_limits::max() >> info::shift)) * + (intermediate_type(1) << info::shift)) + + ((intermediate_type(1) << info::shift) - 1))); constexpr auto no_overflow_max_exponent = - (max_intermediate_value + std::min(info::subtract, 0)) / info::multiply; + (max_intermediate_value + std::min(info::subtract, intermediate_type(0))) / info::multiply; constexpr auto min_intermediate_value = std::max(std::numeric_limits::min(), - (std::max(static_cast(std::numeric_limits::min()), - (std::numeric_limits::min() + - (intermediate_type(1) << (info::shift + 1)) - 2) >> - info::shift) - << info::shift) - - ((intermediate_type(1) << info::shift) - 1)); + intermediate_type( + (std::max(static_cast(std::numeric_limits::min()), + intermediate_type((std::numeric_limits::min() + + (intermediate_type(1) << (info::shift + 1)) - 2) >> + info::shift)) * + (intermediate_type(1) << info::shift)) - + ((intermediate_type(1) << info::shift) - 1))); constexpr auto no_overflow_min_exponent = - (min_intermediate_value + std::max(info::subtract, 0)) / + (min_intermediate_value + std::max(info::subtract, intermediate_type(0))) / info::multiply; // (negative) / (positive) computes the ceiling in C/C++. @@ -220,8 +222,8 @@ static verify_result verify(std::string_view name, std::size_t tier, template