{"id":20400449,"url":"https://github.com/kotet/bigfixed","last_synced_at":"2026-03-10T05:01:55.919Z","repository":{"id":77311603,"uuid":"92642621","full_name":"kotet/bigfixed","owner":"kotet","description":"Arbitrary-precision fixed point number that using std.bigint internally","archived":false,"fork":false,"pushed_at":"2017-08-13T21:19:53.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-05T01:32:25.537Z","etag":null,"topics":["dlang","dub","fixed-point"],"latest_commit_sha":null,"homepage":null,"language":"D","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kotet.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":"2017-05-28T05:51:53.000Z","updated_at":"2019-09-15T07:58:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"e9877293-7296-4bd3-9ba0-b83724f98acc","html_url":"https://github.com/kotet/bigfixed","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/kotet/bigfixed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kotet%2Fbigfixed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kotet%2Fbigfixed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kotet%2Fbigfixed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kotet%2Fbigfixed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kotet","download_url":"https://codeload.github.com/kotet/bigfixed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kotet%2Fbigfixed/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30325598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"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":["dlang","dub","fixed-point"],"created_at":"2024-11-15T04:40:22.637Z","updated_at":"2026-03-10T05:01:55.894Z","avatar_url":"https://github.com/kotet.png","language":"D","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bigfixed\n\n[![Build Status](https://travis-ci.org/kotet/bigfixed.svg?branch=master)](https://travis-ci.org/kotet/bigfixed)\n[![Coverage Status](https://coveralls.io/repos/github/kotet/bigfixed/badge.svg)](https://coveralls.io/github/kotet/bigfixed)\n[![DUB](https://img.shields.io/dub/v/bigfixed.svg)](https://code.dlang.org/packages/bigfixed)\n[![DUB](https://img.shields.io/dub/dt/bigfixed.svg)](https://code.dlang.org/packages/bigfixed)\n\nThis module provides arbitrary precision fixed-point arithmetic.\n\n```d\n// Return the square root of `n` to `prec` decimal places by a method of bisection.\nstring sqrt(ulong n, size_t prec)\n{\n    import std.conv : to;\n    import std.math : ceil, log10;\n\n    immutable size_t q = (prec / log10(2.0)).ceil.to!size_t() + 1;\n    auto low = BigFixed(0, q);\n    auto high = BigFixed(n, q);\n\n    while ((high - low) != high.resolution) // BigFixed is integer internally.\n    {\n        immutable BigFixed mid = (high + low) \u003e\u003e 1; // Shift Expressions can be used.\n        immutable bool isLess = (mid * mid) \u003c n;\n        if (isLess)\n        {\n            low = mid;\n        }\n        else\n        {\n            high = mid;\n        }\n    }\n    return low.toDecimalString(prec);\n}\n// 10 digits before the 1,000th digit. See http://www.h2.dion.ne.jp/~dra/suu/chi2/heihoukon/2.html\nimmutable sqrt2_tail = \"9518488472\";\nassert(sqrt(2, 1000)[$ - 10 .. $] == sqrt2_tail);\n```\n\n### Documentation\n\nRun `dub fetch bigfixed \u0026\u0026 dub build bigfixed -b docs`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkotet%2Fbigfixed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkotet%2Fbigfixed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkotet%2Fbigfixed/lists"}