{"id":25314981,"url":"https://github.com/p-sira/num-lazy","last_synced_at":"2025-04-07T15:15:53.896Z","repository":{"id":276453123,"uuid":"929342207","full_name":"p-sira/num-lazy","owner":"p-sira","description":"Rust Macros for Writing Numbers for Generic Functions","archived":false,"fork":false,"pushed_at":"2025-02-14T15:39:01.000Z","size":870,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T09:51:28.240Z","etag":null,"topics":["macro","num","numerics","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/p-sira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-02-08T10:20:48.000Z","updated_at":"2025-02-14T15:39:05.000Z","dependencies_parsed_at":"2025-02-08T10:36:18.309Z","dependency_job_id":"f5a82ce1-9b4f-4eab-a08a-b260168456f9","html_url":"https://github.com/p-sira/num-lazy","commit_stats":null,"previous_names":["p-sira/num-lazy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-sira%2Fnum-lazy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-sira%2Fnum-lazy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-sira%2Fnum-lazy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-sira%2Fnum-lazy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p-sira","download_url":"https://codeload.github.com/p-sira/num-lazy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247675602,"owners_count":20977378,"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":["macro","num","numerics","rust"],"created_at":"2025-02-13T17:39:28.485Z","updated_at":"2025-04-07T15:15:53.883Z","avatar_url":"https://github.com/p-sira.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# num-lazy\n\u003cp\u003e\n    \u003ca href=\"https://opensource.org/license/BSD-3-clause\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-BSD--3--Clause-brightgreen.svg\" alt=\"License\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://crates.io/crates/num-lazy\"\u003e\n        \u003cimg src=\"https://img.shields.io/crates/v/num-lazy\" alt=\"Crate\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://docs.rs/num-lazy\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Docs-docs.rs-blue\" alt=\"Documentation\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n**num-lazy** helps you write numbers for generic-typed functions, reduce typing, and improve readability!\n\n## Why Num-Lazy\nLet's write a generic circumference function using `num-trait`.\n```rust\nfn circumference\u003cT: Float\u003e(radius: T) -\u003e T {\n    T::from(2.0).unwrap() * T::from(std::f64::consts::PI).unwrap() * radius\n}\n```\nThis doesn't look too bad. But you can imagine it getting out of hand for more complex functions. This is where num-lazy comes to the rescue! Let's implement using `num-lazy`.\n\n```rust\nfn circumference\u003cT: Float\u003e(radius: T) -\u003e T {\n    two!() * pi!() * radius\n}\n```\n\n## Quick Start\nInstall num-lazy by:\n```shell\n\u003e\u003e cargo add num-lazy\n```\n\nUse `declare_nums!{T}` to bind num-lazy to generic type `T`.\n```rust\nuse num_lazy::declare_nums;\nuse num_traits::Float;\ndeclare_nums!{T}\n\nfn circumference\u003cT: Float\u003e(radius: T) -\u003e T {\n    two!() * pi!() * radius\n}\n\nfn main() {\n    assert!(circumference(1.0_f64) == 6.283185307179586);\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp-sira%2Fnum-lazy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp-sira%2Fnum-lazy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp-sira%2Fnum-lazy/lists"}