Skip to content

Commit

Permalink
update only comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
greg7mdp committed Apr 12, 2022
1 parent 58c0c7f commit 4004a04
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions include/intx/intx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ inline constexpr bool operator!=(const T& x, const uint<N>& y) noexcept
return uint<N>(x) != y;
}

#if !defined(_MSC_VER) || _MSC_VER < 1916 // This kills MSVC 2017 compiler.
#if 0 && (!defined(_MSC_VER) || _MSC_VER < 1916) // This kills MSVC 2017 compiler.
inline constexpr bool operator<(const uint256& x, const uint256& y) noexcept
{
auto xp = uint128{x[2], x[3]};
Expand All @@ -1137,7 +1137,11 @@ inline constexpr bool operator<(const uint256& x, const uint256& y) noexcept
template <unsigned N>
inline constexpr bool operator<(const uint<N>& x, const uint<N>& y) noexcept
{
return subc(x, y).carry;
for (size_t i = uint<N>::num_words; i-- > 1; ) {
if (x[i] != y[i])
return x[i] < y[i];
}
return x[0] < y[0];
}

template <unsigned N, typename T,
Expand Down

0 comments on commit 4004a04

Please sign in to comment.