{"id":21186460,"url":"https://github.com/randomhashtags/swift_huge-numbers","last_synced_at":"2026-05-01T08:32:46.616Z","repository":{"id":152972714,"uuid":"626146119","full_name":"RandomHashTags/swift_huge-numbers","owner":"RandomHashTags","description":"Arbitrary-precision arithmetic library.","archived":false,"fork":false,"pushed_at":"2025-05-02T17:34:12.000Z","size":687,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-02T23:18:40.768Z","etag":null,"topics":["bignum-library","framework","library","linux","macos","swift","swift-library","swift-package"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RandomHashTags.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["RandomHashTags"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-04-10T22:28:50.000Z","updated_at":"2025-05-02T17:34:16.000Z","dependencies_parsed_at":"2025-05-02T18:36:17.104Z","dependency_job_id":null,"html_url":"https://github.com/RandomHashTags/swift_huge-numbers","commit_stats":{"total_commits":130,"total_committers":1,"mean_commits":130.0,"dds":0.0,"last_synced_commit":"fc157fc68df54a3fbaaf1ebb7390e762988619e9"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/RandomHashTags/swift_huge-numbers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RandomHashTags%2Fswift_huge-numbers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RandomHashTags%2Fswift_huge-numbers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RandomHashTags%2Fswift_huge-numbers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RandomHashTags%2Fswift_huge-numbers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RandomHashTags","download_url":"https://codeload.github.com/RandomHashTags/swift_huge-numbers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RandomHashTags%2Fswift_huge-numbers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32490810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bignum-library","framework","library","linux","macos","swift","swift-library","swift-package"],"created_at":"2024-11-20T18:23:48.418Z","updated_at":"2026-05-01T08:32:46.596Z","avatar_url":"https://github.com/RandomHashTags.png","language":"Swift","funding_links":["https://github.com/sponsors/RandomHashTags"],"categories":[],"sub_categories":[],"readme":"# swift_huge-numbers\n\nThis library was created to remove the decimal precision limitation on floats, which is especially useful in scientific applications.\n\n## Installation\n### Requirements\n- Swift \u003e= 5.1\n- macOS \u003e= 10.15\n- iOS \u003e= 13.0\n- tvOS \u003e= 13.0\n- watchOS \u003e= 6.0\n### CocoaPods\n```ruby\npod 'HugeNumbers', '~\u003e 1.0.15'\n```\nor for latest version (may not be uploaded to CocoaPods yet)\n```ruby\npod 'HugeNumbers', :git =\u003e 'https://github.com/RandomHashTags/swift_huge-numbers.git'\n```\n### Swift Package Manager\n```swift\n.package(url: \"https://github.com/RandomHashTags/swift_huge-numbers.git\", from: \"1.1.0\")\n```\n\n## Current features\n- `HugeInt`\n- `HugeFloat`\n- `HugeRemainder`\n- `HugeDecimal`\n- addition, subtraction, multiplication, and division\n- special arithmetic\n  - percent (mod/remainder)\n  - factorial\n  - factors \u0026 shared factors\n  - fraction simplification\n  - square root (n)\n- infinite precision\n\n## Current limitations\n- cannot apply arithmetic to a `HugeFloat` with a `HugeDecimal` and another with a `HugeRemainder`, or vice versa\n- limited special arithmetic\n  - no trigonometry, pi, square root remainder, log\n  \n## Performance\n### Device\niMac19,1 - macOS 13.3.1 - Xcode 14.3 - Swift 5.8 - 1.47 TB free of 2TB - 3.6 GHz 8-Core i9 - 72 GB 2667 MHz DDR4 RAM\n\n**benchmark calculator located in `huge_numbersTests`**\n### Compared to native\nThe tables below display the nanoseconds longer it took this library to calculate the result than native arithmetic.\n\n\\***native calculation overflows; only compared to partial calculation**\n#### `HugeInt`\n|Version      |Scheme           |Left Number      |Right Number     |Addition         |Subtraction      |Multiplication   |Division         |\n|:------------|:---------------:|:---------------:|:---------------:|:---------------:|:---------------:|:---------------:|:---------------:|\n|1.0.6        |DEBUG            |8237502387529357 |397653549738     |~2,800           |~2,400           |~43,000\\*        |~225,000         |\n|1.0.13       |DEBUG            |8237502387529357 |397653549738     |~2,450           |~2,350           |~38,100\\*        |~208,700         |\n|1.0.14       |RELEASE          |8237502387529357 |397653549738     |~170             |~200             |~3,950\\*         |~15,400          |\n|1.0.16       |RELEASE          |8237502387529357 |397653549738     |-                |-                |-                |~4,450           |\n#### `HugeFloat`\n|Version      |Scheme           |Precision        |Left Number      |Right Number     |Addition         |Subtraction      |Multiplication   |Division         |\n|:------------|:---------------:|:---------------:|:---------------:|:---------------:|:---------------:|:---------------:|:---------------:|:---------------:|\n|1.0.6        |DEBUG            |100              |12345.678        |54321.012        |~8,200           |~8,300           |~24,000          |~13,000,000      |\n|1.0.13       |DEBUG            |6                |12345.678        |54321.012        |~8,000           |~8,300           |~22,000          |~410,000         |\n|1.0.13       |DEBUG            |100              |12345.678        |54321.012        |-                |-                |-                |~9,306,000       |\n|1.0.14       |RELEASE          |6                |12345.678        |54321.012        |~790             |~1,080           |~3,300           |~39,500          |\n|1.0.14       |RELEASE          |100              |12345.678        |54321.012        |-                |-                |-                |~660,000         |\n|1.0.16       |RELEASE          |6                |12345.678        |54321.012        |-                |-                |-                |~33,400          |\n|1.0.16       |RELEASE          |100              |12345.678        |54321.012        |-                |-                |-                |~533,000         |\n\n## Contributing\nAdding/improving functionality is always welcome, just make a PR.\n\n## Funding\nSupport the development of this project by sponsoring the developers.\n- [RandomHashTags](https://github.com/sponsors/RandomHashTags)\n\n## License\nPublic Domain. Creative Commons Zero v1.0 Universal.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandomhashtags%2Fswift_huge-numbers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frandomhashtags%2Fswift_huge-numbers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandomhashtags%2Fswift_huge-numbers/lists"}