diff --git a/Sources/BigInt/BigInt.swift b/Sources/BigInt/BigInt.swift index 6c69014..9d7a43f 100644 --- a/Sources/BigInt/BigInt.swift +++ b/Sources/BigInt/BigInt.swift @@ -644,6 +644,10 @@ extension BigInt { (quot[j], r) = v.dividingFullWidth((r, uj)) } + if quot[1] > UInt(Int.max) { + quot.append(0) + } + BigInt._dropExcessWords(words: ") return (quotient: BigInt(_uncheckedWords: quot), remainder: BigInt(r)) }