Skip to content

Commit

Permalink
Select v1
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jun 15, 2020
1 parent dd40cba commit c9f71d5
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions include/intx/intx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,18 +592,10 @@ constexpr uint<N>& operator*=(uint<N>& x, const T& y) noexcept
template <unsigned N>
constexpr uint<N> exp(uint<N> base, uint<N> exponent) noexcept
{
auto result = uint<N>{1};
if (base == 2)
{
auto result = uint<N>{0};
if (exponent < N)
{
auto bit_to_set = static_cast<uint64_t>(exponent);
as_words(result)[bit_to_set / 64] = uint64_t{1} << (bit_to_set % 64);
}
return result;
}
return result << exponent;

auto result = uint<N>{1};
while (exponent != 0)
{
if ((exponent & 1) != 0)
Expand Down

0 comments on commit c9f71d5

Please sign in to comment.