File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
include/hurchalla/factoring/detail Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1616#include < fstream>
1717#include < exception>
1818#include < type_traits>
19+ #include < limits>
1920
2021namespace hurchalla { namespace detail {
2122
@@ -228,10 +229,12 @@ class ImplFactorByTable32
228229 for (std::size_t j=1 ; j<size_wheel_divs; ++j) {
229230 std::uint64_t wd = wheel_divs[j];
230231 std::uint64_t two_wd = wd + wd;
231- odd_coprime_sieve[wd/2 ] = 0 ;
232+ odd_coprime_sieve[static_cast <std:: size_t >( wd/2 ) ] = 0 ;
232233 for (std::uint64_t i=wd*wd; i<wheel_size; i+=two_wd) {
233234 HPBC_CONSTEXPR_ASSERT (i/2 < half_wheel_size);
234- odd_coprime_sieve[i/2 ] = 0 ;
235+ static_assert ((wheel_size-1 )/2 <=
236+ std::numeric_limits<std::size_t >::max ());
237+ odd_coprime_sieve[static_cast <std::size_t >(i/2 )] = 0 ;
235238 }
236239 }
237240
You can’t perform that action at this time.
0 commit comments