abacus: bignum: fix order comparisons
This is a pretty big oversight...
This commit is contained in:
parent
5bc3963317
commit
3397bf4310
2 changed files with 12 additions and 0 deletions
|
|
@ -16,6 +16,10 @@ namespace {
|
|||
auto static constexpr BASE = 10;
|
||||
|
||||
bool do_less_than(digits_type const& lhs, digits_type const& rhs) {
|
||||
if (lhs.size() != rhs.size()) {
|
||||
return lhs.size() < rhs.size();
|
||||
}
|
||||
|
||||
return std::lexicographical_compare(lhs.rbegin(), lhs.rend(), rhs.rbegin(),
|
||||
rhs.rend());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue