mirror of
https://github.com/rzmk/ladderz.git
synced 2025-12-19 06:59:25 +00:00
docs: list subjects on doc home & add pre_algebra example
This commit is contained in:
parent
c63e973140
commit
b4d484686f
2 changed files with 27 additions and 1 deletions
|
|
@ -2,7 +2,11 @@
|
||||||
//!
|
//!
|
||||||
//! Implementations of mathematical and technical concepts in Rust.
|
//! Implementations of mathematical and technical concepts in Rust.
|
||||||
//!
|
//!
|
||||||
//! View [the modules section](#modules) for the various implementations based on the subject.
|
//! ## Subjects
|
||||||
|
//!
|
||||||
|
//! The modules for currently supported subjects are:
|
||||||
|
//!
|
||||||
|
//! - [`pre_algebra`]
|
||||||
//!
|
//!
|
||||||
//! # Example
|
//! # Example
|
||||||
//!
|
//!
|
||||||
|
|
@ -89,4 +93,20 @@
|
||||||
//! Great! We've successfully used the `ladderz` crate to get the factors and factor pairs of a positive integer in sorted order.
|
//! Great! We've successfully used the `ladderz` crate to get the factors and factor pairs of a positive integer in sorted order.
|
||||||
|
|
||||||
/// Various pre-algebra implementations including factor pairs, factors, multiples, and more.
|
/// Various pre-algebra implementations including factor pairs, factors, multiples, and more.
|
||||||
|
///
|
||||||
|
/// # Example
|
||||||
|
///
|
||||||
|
/// ```rust
|
||||||
|
/// use ladderz::pre_algebra::get_factors;
|
||||||
|
///
|
||||||
|
/// fn main() {
|
||||||
|
/// let x: u32 = 10;
|
||||||
|
/// println!("The factors of {x} are {:?}.", get_factors(x));
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
///
|
||||||
|
/// ```console
|
||||||
|
/// The factors of 10 are {1, 5, 2, 10}.
|
||||||
|
/// ```
|
||||||
|
///
|
||||||
pub mod pre_algebra;
|
pub mod pre_algebra;
|
||||||
|
|
|
||||||
6
ladderz/src/main.rs
Normal file
6
ladderz/src/main.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
use ladderz::pre_algebra::get_factors;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let x: u32 = 10;
|
||||||
|
println!("The factors of {x} are {:?}.", get_factors(x));
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue