Skip to content

Commit

Permalink
Fixing function eval_gt in multiprecision.
Browse files Browse the repository at this point in the history
  • Loading branch information
martun committed May 27, 2024
1 parent 7d8211e commit b2c46c7
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,16 @@ namespace boost {
BOOST_MP_FORCEINLINE BOOST_MP_CXX14_CONSTEXPR
typename std::enable_if<!boost::multiprecision::backends::is_trivial_cpp_int_modular<cpp_int_modular_backend<Bits>>::value,
bool>::type
eval_gt(const cpp_int_modular_backend<Bits>& a,
limb_type b) noexcept {
eval_gt(const cpp_int_modular_backend<Bits>& a, limb_type b) noexcept {
auto* limbs = a.limbs();
if (limbs[0] <= b)
return false;
if (limbs[0] > b)
return true;
// std::all_of is not constexpr, so writing manually.
for (std::size_t i = 1; i < a.size(); ++i) {
if (limbs[i] != 0)
return true;
}
return true;
return false;
}

template<unsigned Bits>
Expand Down

0 comments on commit b2c46c7

Please sign in to comment.