Skip to content

Commit

Permalink
Fix to_dec_string producing empty string on "self==0".
Browse files Browse the repository at this point in the history
  • Loading branch information
crochethk committed Jul 24, 2024
1 parent 228465e commit 160fe0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ pub mod mp_int {
let mut quotient = self.clone();
let mut digits: Vec<u8> = vec![];

while quotient != 0 {
while quotient != 0 || digits.is_empty() {
let rem;
(quotient, rem) = quotient.div_with_rem(BASE as DigitT);
digits.push(rem.abs() as u8);
Expand Down

0 comments on commit 160fe0d

Please sign in to comment.