{"id":15749562,"url":"https://github.com/ksxgithub/rounded-div","last_synced_at":"2025-05-13T01:29:28.595Z","repository":{"id":37976074,"uuid":"358759667","full_name":"KSXGitHub/rounded-div","owner":"KSXGitHub","description":"Get rounded result of an integer division","archived":false,"fork":false,"pushed_at":"2025-02-21T18:20:54.000Z","size":46,"stargazers_count":3,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T05:41:22.240Z","etag":null,"topics":["binary","crates","division","integer","library","round","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/rounded-div","language":"Rust","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/KSXGitHub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":null,"patreon":"khai96_","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-04-17T01:37:55.000Z","updated_at":"2025-02-21T18:20:57.000Z","dependencies_parsed_at":"2024-10-25T05:13:40.714Z","dependency_job_id":"53ae3ea9-0975-4860-ae94-e3add59e4413","html_url":"https://github.com/KSXGitHub/rounded-div","commit_stats":{"total_commits":41,"total_committers":3,"mean_commits":"13.666666666666666","dds":0.07317073170731703,"last_synced_commit":"72671ebd7dc3162fa441d9d70ea49cfa1b4dec18"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KSXGitHub%2Frounded-div","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KSXGitHub%2Frounded-div/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KSXGitHub%2Frounded-div/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KSXGitHub%2Frounded-div/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KSXGitHub","download_url":"https://codeload.github.com/KSXGitHub/rounded-div/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253853306,"owners_count":21974093,"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":["binary","crates","division","integer","library","round","rust"],"created_at":"2024-10-04T06:03:22.960Z","updated_at":"2025-05-13T01:29:28.571Z","avatar_url":"https://github.com/KSXGitHub.png","language":"Rust","funding_links":["https://patreon.com/khai96_"],"categories":[],"sub_categories":[],"readme":"# rounded-div\n\n[![Test](https://github.com/KSXGitHub/rounded-div/workflows/Test/badge.svg)](https://github.com/KSXGitHub/rounded-div/actions?query=workflow%3ATest)\n[![Crates.io Version](https://img.shields.io/crates/v/rounded-div?logo=rust)](https://crates.io/crates/rounded-div)\n\nGet rounded result of an integer division.\n\n## Usage Examples\n\n### `const fn rounded_div_*`\n\n```rust\nassert_eq!(rounded_div::i32( 59, 4),  15); // 59/4 is equal to 14.75 which is closer to 15\nassert_eq!(rounded_div::i32( 58, 4),  15); // 58/4 is equal to 14.5 which is rounded to 15\nassert_eq!(rounded_div::i32( 57, 4),  14); // 57/4 is equal to 14.25 which is closer to 14\nassert_eq!(rounded_div::i32(-59, 4), -15);\nassert_eq!(rounded_div::i32(-58, 4), -15);\nassert_eq!(rounded_div::i32(-57, 4), -14);\n```\n\n### `trait RoundedDiv`\n\n```rust\nuse rounded_div::RoundedDiv;\nassert_eq!( 59i32.rounded_div(4),  15); // 59/4 is equal to 14.75 which is closer to 15\nassert_eq!( 58i32.rounded_div(4),  15); // 58/4 is equal to 14.5 which is rounded to 15\nassert_eq!( 57i32.rounded_div(4),  14); // 57/4 is equal to 14.25 which is closer to 14\nassert_eq!(-59i32.rounded_div(4), -15);\nassert_eq!(-58i32.rounded_div(4), -15);\nassert_eq!(-57i32.rounded_div(4), -14);\n```\n\n## License\n\n[MIT](https://git.io/JO4Rf) © [Hoàng Văn Khải](https://ksxgithub.github.io/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksxgithub%2Frounded-div","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksxgithub%2Frounded-div","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksxgithub%2Frounded-div/lists"}