| Crates.io | pmath |
| lib.rs | pmath |
| version | 0.1.0 |
| created_at | 2025-08-31 16:55:07.5794+00 |
| updated_at | 2025-08-31 16:55:07.5794+00 |
| description | A general-purpose mathematics crate for Rust |
| homepage | |
| repository | https://github.com/amamic1803/peuler-rs/tree/main/pmath |
| max_upload_size | |
| id | 1818692 |
| size | 147,513 |
pmath is a general-purpose mathematics crate for Rust.
It provides a wide range of mathematical functions and algorithms which heavily use Rust's idiomatic features such as traits, generics, and iterators.
This crate started as a mathematical backend for the peuler crate, but has since evolved into a standalone crate.
use pmath::{gcd, ord};
use pmath::primes::is_prime;
assert_eq!(gcd(48, 18), 6);
assert_eq!(ord(3, 7), 6);
assert!(is_prime(29).0);
There is currently no support for no-std environments.
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 project is licensed under the MIT License.
Contributions are welcome!
Please open an issue or a pull request in the GitHub repository.