BigInt icon indicating copy to clipboard operation
BigInt copied to clipboard

Arbitrary-precision arithmetic in pure Swift

Results 20 BigInt issues
Sort by recently updated
recently updated
newest added

Would it be possible to change the syntax? Thx .

First batch of tests from [Violet - Python VM written in Swift](https://github.com/LiarPrincess/Violet) (connected to [ #98 Using tests from “Violet - Python VM written in Swift”](https://github.com/attaswift/BigInt/issues/98)). # Test failures ##...

Hi, Recently I had to write my own `BigInt` implementation for [Violet - Python VM written in Swift](https://github.com/LiarPrincess/Violet). Internally I decided to use [ManagedBufferPointer](https://developer.apple.com/documentation/swift/managedbufferpointer) instead of Swift `Array`. The whole...

Hi, As I mentioned in [#97 Using `ManagedBufferPointer` instead of `Array` as a storage](https://github.com/attaswift/BigInt/issues/97) I also implemented my own version of `BigInt` for [Violet - Python VM written in Swift](https://github.com/LiarPrincess/Violet)....

Hello, I've wanted to update BigInt from version 5.2.0 to 5.3.0, yet the CocoaPodsSpecs is not present. - https://cocoapods.org/pods/BigInt - https://github.com/CocoaPods/Specs/tree/master/Specs/6/5/b/BigInt Is CocoaPods still supported ? Can I do anything...

For now, we can initialize with `Data`, so from a `[UInt8]` using `Data(bytes)`. Could we implement a more optimized way to use `[UInt8]` directly without a conversion to `Data`? (To...

Any plans to implement nonzeroBitCount? if it is an easy way to do this please let me know how!

The README's `generatePrime(_ width: Int)` function is very slow for big numbers (can take up to 10s to generate two primes for a RSA key) ```swift func generatePrime(_ width: Int)...

Signed bitwise shift doesn't work. Example: ``` Int(65764) >> 16 // gives 1 Int(-65764) >> 16 // gives -2 BigInt(65764) >> 16 // gives -1 BigInt(-65764) >> 16 // gives...

I just instrumented my code and BigInt division seems to be a bottleneck with 32 byte division. Wondering if it's possible to use a faster algorithm? A quick google returns...