| Crates.io | peuler |
| lib.rs | peuler |
| version | 0.1.0 |
| created_at | 2025-08-31 17:56:18.17549+00 |
| updated_at | 2025-08-31 17:56:18.17549+00 |
| description | A Rust crate with solutions to the Project Euler problems |
| homepage | |
| repository | https://github.com/amamic1803/peuler-rs/tree/main/peuler |
| max_upload_size | |
| id | 1818730 |
| size | 486,158 |
peuler is a Rust crate with solutions to the Project Euler problems.
It contains solutions to the problems that I have solved so far, and I plan to add more solutions as I solve more problems.
Many general-purpose mathematical functions are offloaded to the pmath crate.
use peuler::{PEuler, ProjectEuler};
let peuler = PEuler::new();
assert_eq!(peuler.solve(1).unwrap(), "233168");
There is currently no support for no-std environments.
Since this crate depends on pmath,
which in turn depends on getrandom,
wasm32-unknown-unknown target is supported, but requires --cfg getrandom_backend="wasm_js" flag to be passed to the compiler.
See getrandom crate's documentation for more details.
Other WASM targets should work out of the box.
This crate also provides a command line interface (CLI) binary named peuler.
You can install it via cargo:
cargo install --features=cli peuler
Then, to solve the first Project Euler problem, run:
peuler 1
For more information, run:
peuler --help
This crate has the following optional (disabled by default) features:
cli: Enables the optional dependencies for building the CLI binary.
This project is licensed under the MIT License.
Contributions to the currently available problems are welcome!
Please open an issue or a pull request in the GitHub repository.
Don't submit solutions to the currently unsolved problems, as I plan to solve them on my own.