peuler

Crates.iopeuler
lib.rspeuler
version0.1.0
created_at2025-08-31 17:56:18.17549+00
updated_at2025-08-31 17:56:18.17549+00
descriptionA Rust crate with solutions to the Project Euler problems
homepage
repositoryhttps://github.com/amamic1803/peuler-rs/tree/main/peuler
max_upload_size
id1818730
size486,158
Antonio Mamić (amamic1803)

documentation

README

peuler

GitHub Repository Static Badge Crates.io Version docs.rs GitHub Actions Workflow Status GitHub License

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.

Example

use peuler::{PEuler, ProjectEuler};

let peuler = PEuler::new();
assert_eq!(peuler.solve(1).unwrap(), "233168");

No-std support

There is currently no support for no-std environments.

WebAssembly support

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.

Command Line Interface

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

Features

This crate has the following optional (disabled by default) features:

  • cli: Enables the optional dependencies for building the CLI binary.

License

This project is licensed under the MIT License.

Contributing

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.

Commit count: 149

cargo fmt