Ariprog
I 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.
The objetive of ariprog is to solve the main problems around APs. Here's a list of what it's capable of.
- Get common difference (d)
- Get nth term (an)
- Get first term (a)
- Get how many terms in the AP (n)
- Interpolate/insert arithmetic means
- Get common difference and first term (d, a)
In the API section, you'll see the corresponding functions and how to use them.
๐ Usage
Installation
First, create a new Rust project or open an existing one
# or
Then, add ariprog as a dependency
As an alternative, you can add the following line in your Cargo.toml
(dependencies section)
Getting started
use ;
API
First things first, after adding ariprog in your project, import it.
use ariprog;
- Get common difference (d):
ariprog::common_difference
- Get nth term (an):
ariprog::nth_term
- Get first term (a):
ariprog::first_term
- Insert/interpolate arithmetic means:
ariprog::insert_arithmetic_means
- Get how many terms in the AP (n):
ariprog::how_many_terms
- Get common difference and first term (d, a):
ariprog::common_difference_and_first_term
All of these functions have their own documentation. See in docs.rs or in your IDE.
๐ Contributing
Feel 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.
How to contribute
- Fork this repository
- Clone your fork on your machine
- Make your changes, commit and push these
- Open a pull request (write a descriptive message about what you changed)
๐งช Testing
To test ariprog, with the project in your machine, run cargo test
.
You should create tests in tests/unit_test.rs
, however if you think that your tests should be in other module, do it and explain why in the PR.
๐ License
This project is licensed under the MIT License - See the LICENSE for more information.
Made with โค and ๐ฆ by Kauรช Fraga Rodrigues.