This project is a work in progress. Currently integer and some floating-point functions are implemented.
Currently libgmp.a 6.1.1 is included. You can rebuild it using the GMP iOS Builder.
Add the following to your Cartfile:
github "NeoTeo/SwiftGMP" "master"
Then, in the root of your project, type: carthage update
- Select your target's Build Phases tab.
- Select the Link Binary With Libraries, click the + and then Add Other... buttons.
- Navigate to the Carthage/Build/Mac directory in your project root and select the SwiftGMP.framework.
In case of a code signing error, select the target's Build Settings tab make sure the "Code Signing Identity" is either a valid identity or "Don't Code Sign".
For more information on how to install via Carthage see the README.
This is part of Xcode 8.
A full set of examples can be found in our test suite.
import SwiftGMP
let s2d = SwiftGMP.GMPDouble("12356789123456789.9876")
let d2d = SwiftGMP.GMPDouble(12345.678)
print(String(s2d + d2d))
Contributions are welcome! Check out the issues.
GMP follows the GNU LGPL v3 and GNU GPL v2 licenses. This project has an additional MIT license.