diff --git a/Sources/BigInt/BigInt.swift b/Sources/BigInt/BigInt.swift index 3d1006d..ec8ebae 100644 --- a/Sources/BigInt/BigInt.swift +++ b/Sources/BigInt/BigInt.swift @@ -358,6 +358,9 @@ extension BigInt: BinaryInteger { float = (float / radix).rounded(.towardZero) } while float != 0 + if let last = words.last, last >= Int.max { + words.append(0) + } self.words = words }