abacus: bignum: fix comparison of negative numbers
This commit is contained in:
parent
3e5133da1a
commit
a382b299b0
2 changed files with 33 additions and 1 deletions
|
|
@ -363,7 +363,11 @@ bool BigNum::less_than(BigNum const& rhs) const {
|
|||
return sign_ < rhs.sign_;
|
||||
}
|
||||
|
||||
return do_less_than(digits_, rhs.digits_);
|
||||
if (is_positive()) {
|
||||
return do_less_than(digits_, rhs.digits_);
|
||||
} else {
|
||||
return do_less_than(rhs.digits_, digits_);
|
||||
}
|
||||
}
|
||||
|
||||
void BigNum::canonicalize() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue