abacus: bignum: trim zeros after a subtraction
This way we keep a canonicalized version of the result.
This commit is contained in:
parent
3397bf4310
commit
cfa19a60ba
|
@ -82,6 +82,8 @@ digits_type do_substraction(digits_type const& lhs, digits_type const& rhs) {
|
|||
std::transform(complement.begin(), complement.end(), complement.begin(),
|
||||
take_complement);
|
||||
|
||||
do_trim_leading_zeros(complement);
|
||||
|
||||
return complement;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue