Swift BigInteger?

I recently ran across the need for a large integer in Swift – something that needs more than the 64 bits provided by Int64. This is not the first time. I have played around with Swift Decimal in the past (NSDecimal, NSDecimalNumber) only to find they come up short in precisely representing a rational number. Python, for example, makes it trivial to find the Nth decimal place of any rational number by storing the repeating decimal pattern under the hood and making that info available to you.

This poor substitute of mine only supports the binary OR and POPULATION operations and has no string representation. But it worked for what I needed.

 

The Gap

So I’ve been silent here for the better part of a year, and I just wanted to say why: I made  a major career change and started a new job. I write Android apps for a tech company here in Williamsburg, VA now. The job is great, but I have been very busy. I intend to continue posting about iOS, Math, Python, AI, Databases, and now Android.

Cheers!