Large number arithmetic in Swift.
Package | Swift | iOS | iPadOS | Mac Catalyst | macOS | tvOS | watchOS |
---|---|---|---|---|---|---|---|
0.6.2 | 5.7 | 13.0 | 13.0 | 13.0 | 10.15 | 13.0 | 6.0 |
2.2.0 | 5.8 | 16.4 | 16.4 | 16.4 | 13.3 | 16.4 | 9.4 |
A composable, large, fixed-width, two's complement, binary integer.
:jigsaw: | Composable |
:two_hearts: | Two's Complement |
:european_castle: | Fixed Width Integer |
:book: | Trivial UInt Collection |
:rocket: | Single Digit Arithmetic |
typealias Int256 = FullWidth< Int128, UInt128>
typealias UInt256 = FullWidth<UInt128, UInt128>
A decorative, width agnostic, sign-and-magnitude, numeric integer.
:ribbon: | Decorative |
:ringed_planet: | Sign & Magnitude |
:100: | Numeric |
:rocket: | Single Digit Arithmetic |
typealias Magnitude = UInt
let min = Signed(Magnitude.max, as: Sign.minus)
let max = Signed(Magnitude.max, as: Sign.plus )
Models, protocols, extensions and utilities underpinning this package.
Numberick is a more pragmatic solution to the same problem.
link |
Stars: 5 |
Last commit: 8 hours ago |
New and improved comparisons. A fix thereof.
Signed
's <
operatorfunc compared(to other: Self) -> Int // -1, 0, 1
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics