Half is a lightweight framework containing a Swift implementation for a half-precision floating point type for iOS, macOS, tvOS, and watchOS.
To install via CocoaPods, simply add the following line to your Podfile:
To install via Carthage, simply add the following line to your Cartfile:
To install via the Swift Package Manager add the following line to your
.package(url: "https://github.com/SomeRandomiOSDev/Half.git", from: "1.0.0")
First import Half at the top of your Swift file:
After importing, use the imported
Half type excatly like you'd use Swift's builtin
let value: Half = 7.891 let squareRoot = sqrt(value) ...
- Add support for SIMD functions & types with half-precision
If you have need for a specific feature or you encounter a bug, please open an issue. If you extend the functionality of Half yourself or you feel like fixing a bug yourself, please submit a pull request.
Joseph Newton, [email protected]
Half is based heavily on the implementations of the
Float80 structures provided by Swift. See
ATTRIBUTIONS for more details.
Half is available under the MIT license. See the
LICENSE file for more info.