diff --git a/lib-nested-core/src/editors/integer/radix.rs b/lib-nested-core/src/editors/integer/radix.rs index 36213a9..685452b 100644 --- a/lib-nested-core/src/editors/integer/radix.rs +++ b/lib-nested-core/src/editors/integer/radix.rs @@ -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; + } } } }