radix convert: accept radix=0 for native digit radix (2^64)
This commit is contained in:
parent
0bcfd7a65a
commit
e7331b36ae
1 changed files with 7 additions and 3 deletions
|
@ -115,6 +115,9 @@ impl RadixProjection {
|
|||
let mut val = src.get_value();
|
||||
if val == 0 {
|
||||
self.dst_digits.push(0);
|
||||
} else {
|
||||
if self.dst_radix == 0 {
|
||||
self.dst_digits.push(val);
|
||||
} else {
|
||||
while val > 0 {
|
||||
self.dst_digits.push(val % self.dst_radix);
|
||||
|
@ -122,6 +125,7 @@ impl RadixProjection {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let new_len = self.dst_digits.len();
|
||||
for i in 0 .. usize::max(old_len, new_len) {
|
||||
|
|
Loading…
Reference in a new issue