AwesomeNumbersKit

Swift 中的大数算术。

Swift iOS iPadOS Mac Catalyst macOS tvOS watchOS
4.0.2 5.8 16.4 16.4 16.4 13.3 16.4 9.4

重要提示

此项目的开发已转移至 Numberick

ANKCoreKit (Sources, Tests, Benchmarks)

支撑此包的模型、协议、扩展和实用程序。

协议

ANKFullWidthKit (Sources, Tests, Benchmarks)

一个可组合的、大型的、固定宽度的、二进制补码整数。

🧩 可组合
💕 二进制补码
🏰 固定宽度整数
📖 简单的 UInt 集合
🚀 单位数算术
typealias  Int256 = ANKFullWidth< Int128, UInt128>
typealias UInt256 = ANKFullWidth<UInt128, UInt128>

ANKSignedKit (Sources, Tests, Benchmarks)

一个装饰性的、宽度无关的、符号-幅度表示法的数值整数。

🎀 装饰性的
🪐 符号 & 幅度
💯 数值的
🚀 单位数算术
typealias Magnitude = UInt
let min = ANKSigned(Magnitude.max, as: FloatingPointSign.minus)
let max = ANKSigned(Magnitude.max, as: FloatingPointSign.plus )

查看我的其他项目

Numberick 是解决同一问题的更实用的方案。