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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With