{"id":18762056,"url":"https://github.com/mgriebling/bigdecimal","last_synced_at":"2025-04-13T03:32:04.406Z","repository":{"id":175825341,"uuid":"653830972","full_name":"mgriebling/BigDecimal","owner":"mgriebling","description":"Arbitrary-precision decimal arithmetic in Swift with full math functions and fixed-precision Decimal 32-, 64-, and 128-bit types.","archived":false,"fork":false,"pushed_at":"2024-10-16T19:02:43.000Z","size":5294,"stargazers_count":34,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T21:22:02.009Z","etag":null,"topics":["arbitrary-precision","bigdecimal","decimal-functions","decimal-numbers","decimal128","decimal32","decimal64","math"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"leif-ibsen/BigDecimal","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mgriebling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-14T20:43:07.000Z","updated_at":"2025-03-26T19:59:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"579d882f-ff68-45ad-a8fe-055cf64d8938","html_url":"https://github.com/mgriebling/BigDecimal","commit_stats":null,"previous_names":["mgriebling/bigdecimal-1","mgriebling/bigdecimal"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgriebling%2FBigDecimal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgriebling%2FBigDecimal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgriebling%2FBigDecimal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgriebling%2FBigDecimal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgriebling","download_url":"https://codeload.github.com/mgriebling/BigDecimal/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248659679,"owners_count":21141158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arbitrary-precision","bigdecimal","decimal-functions","decimal-numbers","decimal128","decimal32","decimal64","math"],"created_at":"2024-11-07T18:19:01.674Z","updated_at":"2025-04-13T03:32:01.592Z","avatar_url":"https://github.com/mgriebling.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fmgriebling%2FBigDecimal%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/mgriebling/BigDecimal)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fmgriebling%2FBigDecimal%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/mgriebling/BigDecimal)\n\n# BigDecimal\n\nThe BigDecimal package provides arbitrary-precision (with an adjustable upper\nlimit for performance) and fixed-precision decimal arithmetic in Swift.\n\nIts functionality falls in the following categories:\n- Arithmetic: addition, subtraction, multiplication, division, remainder and \n  exponentiation\n- Added arbitrary complex decimal number support with the `CBDecimal` type using\n  `swift-numerics`.\n- Compliant with `DecimalFloatingPoint` and `Real` protocols.\n- Constants: `pi`, `zero`, `one`, `ten`\n- Functions: exp, log, log10, log2, pow, sqrt, root, factorial, gamma, \n             trig + inverse, hyperbolic + inverse\n- Rounding and scaling according to one of the rounding modes:\n    - awayFromZero\n    - down\n    - towardZero\n    - toNearestOrEven\n    - toNearestOrAwayFromZero\n    - up\n\n- Comparison: the six standard operators `==`, `!=`, `\u003c`, `\u003c=`, `\u003e`, and `\u003e=`\n- Conversion: to/from String, to/from  Double, to/from  Decimal (the Swift \n  Foundation type), to/from Decimal32 / Decimal64 / Decimal128\n- Support for Decimal32, Decimal64 and Decimal128 values stored as UInt32, \n  UInt64 and UInt128 values respectively, using Densely Packed Decimal (DPD) \n  encoding or Binary Integer Decimal (BID) encoding\n- Support for Decimal32, Decimal64 and Decimal128 mathematical operations\n- Supports the IEEE 754 concepts of Infinity and NaN (Not a Number) with the\n  latter having a `signaling` option.\n\n## Dependencies\nBigDecimal requires Swift from macOS 13.3+, iOS 16.4+, macCatalyst 13.3+, \ntvOS 16.4+, or watchOS 9.4+. It also requires that the `Int` type be a 64-bit \ntype.\n\nThe BigDecimal package depends on the BigInt, UInt128, and swift-numerics packages.\n\n```\ndependencies: [\n  .package(url: \"https://github.com/mgriebling/BigInt.git\", from: \"2.2.0\")        \n  .package(url: \"https://github.com/apple/swift-numerics\", from: \"1.0.0\"),\n  .package(url: \"https://github.com/mgriebling/UInt128.git\", from: \"3.1.5\")\n]\n```\n\n## Usage\nIn your project's Package.swift file add a dependency like:\n\n```\ndependencies: [\n  .package(url: \"https://github.com/mgriebling/BigDecimal.git\", from: \"3.0.2\"),\n]\n```\n\n## Known Issues\nTests for some of the Decimal32 conversions and opeations currently fail.\nIf you would like to fix the commented-out tests I would encourage you to\ndo so and feed back your fixes.  I don't think this is a huge deal for\nmost people who have the Decimal64 and Decimal128 types to use.  Frankly,\nI'm only using the BigDecimal arbitrary precision so likely won't address\nthis as being urgent. The key problems with Decimal32 seem to be in how\nit is being rounded after calculations. \n\n## Documentation\nThe documentation is built with the DocC plugin and published on GitHub Pages at this location:\n\nhttps://mgriebling.github.io/BigDecimal/documentation/bigdecimal\n\nThe documentation is also available in the *BigDecimal.doccarchive* file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgriebling%2Fbigdecimal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgriebling%2Fbigdecimal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgriebling%2Fbigdecimal/lists"}