Is there an equivalent to Java's BigInteger class in Swift? I am tying to do large calculations in Swift with positive integers larger than UInt64 maximum valye.
BigInteger
UInt64
What is the best way to handle these numbers in Swift?
You can use the NSDecimalNumber class from Cocoa. It is not infinite precision, but it can represent 38 decimal digits of precision, which may be enough for what you need.
NSDecimalNumber
2.1m questions
2.1m answers
60 comments
57.0k users