integer radix convert: insert one zero digit in case value is zero

This commit is contained in:
Michael Sippel 2024-08-09 02:31:26 +02:00
parent 8d637a6f32
commit 786866746c
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -113,9 +113,13 @@ impl RadixProjection {
if let Some(src) = self.src.as_ref() { if let Some(src) = self.src.as_ref() {
let mut val = src.get_value(); let mut val = src.get_value();
while val > 0 { if val == 0 {
self.dst_digits.push(val % self.dst_radix); self.dst_digits.push(0);
val /= self.dst_radix; } else {
while val > 0 {
self.dst_digits.push(val % self.dst_radix);
val /= self.dst_radix;
}
} }
} }