A Swift package extending numeric protocols, standard numeric types, and experimental numeric types.
Numerics Extended provides a layered set of numeric protocols and utilities for Swift. It includes core numeric
operators, core numeric protocols, extensions for standard library numeric protocols, standard numeric type
conformances, experimental numeric constants, experimental numeric protocols, and experimental numeric types such as
Fraction, Roman, Int4, and UInt4.
Experimental numeric types are included for exploration and documentation, and their APIs may evolve across major releases.
- Swift 6.3+
Numerics Extended is written in Swift and avoids platform-specific APIs where possible.
-
Add Numerics Extended to the dependencies in your
Package.swiftfile:let package: Package = .init( ... dependencies: [ .package( url: "https://github.com/bikecalc/swift-numerics-extended.git", from: "2.0.0" ) ], ... )
-
Add the
NumericsExtendedproduct to the dependencies of the target that will import it. ReplaceYourTargetwith the name of that target:let package: Package = .init( ... targets: [ .target( name: "YourTarget", dependencies: [ .product( name: "NumericsExtended", package: "swift-numerics-extended" ) ] ) ], ... )
-
Import the package in your source code:
import NumericsExtended
You can read more about this package by visiting the documentation.
Everyone is welcome to contribute to Numerics Extended. See CONTRIBUTING.md for contribution guidelines, branch
conventions, pull request expectations, and testing instructions.
If you find a bug, please create an issue. Security
vulnerabilities should be reported using the instructions in SECURITY.md.
This project follows a code of conduct. See CODE_OF_CONDUCT.md for more information.
Distributed under Apache License v2.0 with Runtime Library Exception. See LICENSE.md for more information.
