mkrd/Swift-BigInt

BigInt initializer crashes on large integers

Closed this issue · 0 comments

BigInt(UInt64.max), when executed, will crash, throwing "Swift/Integers.swift:3564: Fatal error: Not enough bits to represent the passed value". This is likely due the BigInt initializer trying and failing to convert a UInt64 value to Int.
The following code does not crash: BigInt(String(UInt64.max))!