Skip to content

Commit

Permalink
protect find_msb from passing 0
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMlashkin committed Sep 25, 2024
1 parent f907d00 commit 38f3a19
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ namespace boost {
return i * cpp_int_modular_backend<Bits>::limb_bits +
boost::multiprecision::detail::find_msb(a.limbs()[i]);
}
if (a.limbs()[0] == 0)
return 0;
return boost::multiprecision::detail::find_msb(a.limbs()[0]);
}

Expand Down

0 comments on commit 38f3a19

Please sign in to comment.