radix convert: accept radix=0 for native digit radix (2^64)

This commit is contained in:
Michael Sippel 2024-08-22 17:39:02 +02:00
parent 0bcfd7a65a
commit e7331b36ae
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -116,9 +116,13 @@ impl RadixProjection {
if val == 0 {
self.dst_digits.push(0);
} else {
while val > 0 {
self.dst_digits.push(val % self.dst_radix);
val /= self.dst_radix;
if self.dst_radix == 0 {
self.dst_digits.push(val);
} else {
while val > 0 {
self.dst_digits.push(val % self.dst_radix);
val /= self.dst_radix;
}
}
}
}