{"id":23038780,"url":"https://github.com/kauefraga/ariprog","last_synced_at":"2025-08-14T18:33:02.523Z","repository":{"id":227168632,"uuid":"770285402","full_name":"kauefraga/ariprog","owner":"kauefraga","description":"Need a powerful and simple library to work with arithmetic progressions in Rust? You should definitively try out ariprog!","archived":false,"fork":false,"pushed_at":"2024-03-16T19:57:06.000Z","size":43,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-20T05:07:16.567Z","etag":null,"topics":["arithmetic-progression","math","rust","study-project"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/ariprog","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/kauefraga.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}},"created_at":"2024-03-11T09:37:01.000Z","updated_at":"2024-05-08T15:24:31.000Z","dependencies_parsed_at":"2024-03-16T10:43:24.831Z","dependency_job_id":"2e8f828a-86e0-4f0b-8238-944a6ba7553c","html_url":"https://github.com/kauefraga/ariprog","commit_stats":null,"previous_names":["kauefraga/ariprog"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kauefraga%2Fariprog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kauefraga%2Fariprog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kauefraga%2Fariprog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kauefraga%2Fariprog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kauefraga","download_url":"https://codeload.github.com/kauefraga/ariprog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229857934,"owners_count":18135148,"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":["arithmetic-progression","math","rust","study-project"],"created_at":"2024-12-15T18:25:25.660Z","updated_at":"2024-12-15T18:25:26.107Z","avatar_url":"https://github.com/kauefraga.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ariprog\n\n![GitHub top language](https://img.shields.io/github/languages/top/kauefraga/ariprog)\n![Crates.io Version](https://img.shields.io/crates/v/ariprog)\n![GitHub's license](https://img.shields.io/github/license/kauefraga/ariprog)\n![GitHub last commit (branch)](https://img.shields.io/github/last-commit/kauefraga/ariprog/main)\n\nI had a test (03/2024) on arithmetic progressions, so I decided to create a library to study math. Taking advantage of the fact that I was studying Rust and APs, I created this library.\n\nThe objetive of **ariprog** is to solve the main problems around APs. Here's a list of what it's capable of.\n\n- [x] Get common difference (d)\n- [x] Get nth term (an)\n- [x] Get first term (a)\n- [x] Get how many terms in the AP (n)\n- [x] Interpolate/insert arithmetic means\n- [x] Get common difference and first term (d, a)\n\nIn the [API](#api) section, you'll see the corresponding functions and how to use them.\n\n## 🛠 Usage\n\n### Installation\n\nFirst, create a new Rust project or open an existing one\n\n```bash\ncargo new testing-ariprog\ncd testing-ariprog\n\n# or\ncd existing-project\n```\n\nThen, add [**ariprog**](https://crates.io/crates/ariprog) as a dependency\n\n```bash\ncargo add ariprog\n```\n\nAs an alternative, you can add the following line in your `Cargo.toml` (dependencies section)\n\n```bash\nariprog = \"0.1.4\"\n```\n\n### Getting started\n\n```rust\nuse ariprog::{\n    common_difference,\n    nth_term\n};\n\nfn main() {\n    let common_diff = common_difference(6.0, 2.0); // expected 4.0\n\n    println!(\n        \"The common difference in the AP [2.0, 6.0, 10.0, 14.0] is {}\",\n        common_diff\n    );\n\n    println!(\n        \"The seventeenth term of the AP [2.0, 6.0, 10.0, 14.0, ...] is {}\",\n        nth_term(2.0, common_diff, 17.0)\n    ); // expected 66.0\n}\n```\n\n### API\n\nFirst things first, after adding **ariprog** in your project, import it.\n\n```rust\nuse ariprog;\n```\n\n- Get common difference (d): `ariprog::common_difference`\n- Get nth term (an): `ariprog::nth_term`\n- Get first term (a): `ariprog::first_term`\n- Insert/interpolate arithmetic means: `ariprog::insert_arithmetic_means`\n- Get how many terms in the AP (n): `ariprog::how_many_terms`\n- Get common difference and first term (d, a): `ariprog::common_difference_and_first_term`\n\nAll of these functions have their own documentation. See in [docs.rs](https://docs.rs/ariprog) or in your IDE.\n\n## 💖 Contributing\n\nFeel free to fork it, make a change and open a pull request. Same for issues, suggest an API change, an improvement, a feature or report a bug.\n\n### How to contribute\n\n1. Fork this repository\n2. Clone your fork on your machine\n3. Make your changes, commit and push these\n4. Open a pull request (write a descriptive message about what you changed)\n\n## 🧪 Testing\n\nTo test ariprog, with the project in your machine, run `cargo test`.\n\nYou should create tests in [`tests/unit_test.rs`](tests/unit_test.rs), however if you think that your tests should be in other module, do it and explain why in the PR.\n\n## 📝 License\n\nThis project is licensed under the MIT License - See the [LICENSE](https://github.com/kauefraga/ariprog/blob/main/LICENSE) for more information.\n\n---\n\nMade with ❤ and 🦀 by Kauê Fraga Rodrigues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkauefraga%2Fariprog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkauefraga%2Fariprog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkauefraga%2Fariprog/lists"}