integer radix convert: insert one zero digit in case value is zero
This commit is contained in:
parent
8d637a6f32
commit
786866746c
1 changed files with 7 additions and 3 deletions
|
@ -113,9 +113,13 @@ impl RadixProjection {
|
|||
|
||||
if let Some(src) = self.src.as_ref() {
|
||||
let mut val = src.get_value();
|
||||
while val > 0 {
|
||||
self.dst_digits.push(val % self.dst_radix);
|
||||
val /= self.dst_radix;
|
||||
if val == 0 {
|
||||
self.dst_digits.push(0);
|
||||
} else {
|
||||
while val > 0 {
|
||||
self.dst_digits.push(val % self.dst_radix);
|
||||
val /= self.dst_radix;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue