mgriebling/bigdecimal
The BigDecimal package provides arbitrary-precision (with an adjustable upper
Dependencies
BigDecimal requires Swift from macOS 13.3+, iOS 16.4+, macCatalyst 13.3+, tvOS 16.4+, or watchOS 9.4+. It also requires that the Int type be a 64-bit type.
The BigDecimal package depends on the BigInt, UInt128, and swift-numerics packages.
dependencies: [
.package(url: "https://github.com/mgriebling/BigInt.git", from: "2.2.0")
.package(url: "https://github.com/apple/swift-numerics", from: "1.0.0"),
.package(url: "https://github.com/mgriebling/UInt128.git", from: "3.1.5")
]Usage
In your project's Package.swift file add a dependency like:
dependencies: [
.package(url: "https://github.com/mgriebling/BigDecimal.git", from: "3.0.2"),
]Known Issues
Tests for some of the Decimal32 conversions and opeations currently fail. If you would like to fix the commented-out tests I would encourage you to do so and feed back your fixes. I don't think this is a huge deal for most people who have the Decimal64 and Decimal128 types to use. Frankly, I'm only using the BigDecimal arbitrary precision so likely won't address this as being urgent. The key problems with Decimal32 seem to be in how it is being rounded after calculations.
Documentation
The documentation is built with the DocC plugin and published on GitHub Pages at this location:
https://mgriebling.github.io/BigDecimal/documentation/bigdecimal
The documentation is also available in the BigDecimal.doccarchive file.
Package Metadata
Repository: mgriebling/bigdecimal
Default branch: main
README: README.md