{"id":25357026,"url":"https://github.com/hashcloak/noir-fixed-point","last_synced_at":"2026-02-16T21:36:29.691Z","repository":{"id":271626006,"uuid":"914046520","full_name":"hashcloak/noir-fixed-point","owner":"hashcloak","description":"Fixed point arithmetic library in Noir","archived":false,"fork":false,"pushed_at":"2025-05-09T21:36:07.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-29T23:45:49.524Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Noir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashcloak.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-08T21:02:25.000Z","updated_at":"2025-04-16T22:03:55.000Z","dependencies_parsed_at":"2025-01-30T16:27:41.218Z","dependency_job_id":"ab30bc46-dd6c-4d6a-81d3-3d63ac3a2954","html_url":"https://github.com/hashcloak/noir-fixed-point","commit_stats":null,"previous_names":["hashcloak/noir_fixed_point","hashcloak/noir-fixed-point"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/hashcloak/noir-fixed-point","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashcloak%2Fnoir-fixed-point","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashcloak%2Fnoir-fixed-point/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashcloak%2Fnoir-fixed-point/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashcloak%2Fnoir-fixed-point/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashcloak","download_url":"https://codeload.github.com/hashcloak/noir-fixed-point/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashcloak%2Fnoir-fixed-point/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29519661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T18:37:19.720Z","status":"ssl_error","status_checked_at":"2026-02-16T18:36:46.920Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-02-14T21:01:19.187Z","updated_at":"2026-02-16T21:36:29.663Z","avatar_url":"https://github.com/hashcloak.png","language":"Noir","funding_links":[],"categories":["Libraries"],"sub_categories":["Data Types"],"readme":"# Fixed-Point Arithmetic Library\n\nThis is an optimized fixed point arithmetic library designed for scale 2^-16. It supports signed fixed-point numbers with a specific scale of 2^-16 and provides efficient implementations of standard arithmetic operations such as addition, subtraction, and multiplication.\n\n## Usage\n\n\nTo create a fixed-point number, divide the original value by 2^16 and store the resulting integer:\n```rust\nlet value = Quantized::new(65536); // Represents 65536 / 2^16 = 1.0\nlet small_value = Quantized::new(32768); // Represents 32768 / 2^16 = 0.5\nlet large_value = Quantized::new(131072); // Represents 131072 / 2^16 = 2.0\n```\n\nArithmetic operations. Note that for multiplication we always scale down the value so the result has the same scale as before. \n\n```rust\nlet a = Quantized::new(98304); // Represents 1.5\nlet b = Quantized::new(147456); // Represents 2.25\n\nlet add = a + b; // (98304 + 147456) / 2^16 = 3.75\nlet sub = a - b; // (98304 - 147456) / 2^16 = -0.75\nlet mul = a * b; // (98304 * 147456) / 2^(16 + 16) = 3.375\n```\n\n### Check Negativity\nYou can check whether a fixed-point value is negative:\n```rust\nlet negative_value = Quantized::new(-32768); // Represents -0.5\nlet is_negative = is_negative(negative_value.x); // Returns 1 (true)\n\nlet positive_value = Quantized::new(65536); // Represents 1.0\nlet is_positive_negative = is_negative(positive_value.x); // Returns 0 (false)\n```\n\n## Testing\n\nRun tests with:\n```bash\ncargo test\n```\n\n## Benchmarks\n\nGatecounts: \nAddition \u0026 subtraction: 4217.\nMultiplication: 2932\nDivision: 3732.\nOrdering: 2789. \n\nRerun benchmarks in folder `benchmarks`.\n\n- Nargo `1.0.0-beta.0`\n- bb `0.63.0`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashcloak%2Fnoir-fixed-point","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashcloak%2Fnoir-fixed-point","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashcloak%2Fnoir-fixed-point/lists"}