Swiftpack.co - oscbyspro/AwesomeNumbersKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by oscbyspro.
oscbyspro/AwesomeNumbersKit v2.2.0
Large number arithmetic in Swift
⭐️ 5
🕓 4 weeks ago
iOS macOS watchOS tvOS macCatalyst
.package(url: "https://github.com/oscbyspro/AwesomeNumbersKit.git", from: "v2.2.0")

AwesomeNumbersKit

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

ANKFullWidthKit (Sources, Tests, Benchmarks)

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>

ANKSignedKit (Sources, Tests, Benchmarks)

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 )

ANKFoundation (Sources, Tests, Benchmarks)

Models, protocols, extensions and utilities underpinning this package.

Models

Protocols

Check out my other projects

Numberick is a more pragmatic solution to the same problem.

GitHub

link
Stars: 5
Last commit: 8 hours ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

v2.2.0
4 weeks ago

New and improved comparisons. A fix thereof.

  • #106 Fix Signed's < operator
  • #105 Three-way, and faster, comparisons

New ANKBinaryInteger comparisons

func compared(to other: Self) -> Int // -1, 0, 1

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics