docs: list subjects on doc home & add pre_algebra example

This commit is contained in:
rzmk 2023-09-21 16:44:37 -04:00
parent c63e973140
commit b4d484686f
No known key found for this signature in database
2 changed files with 27 additions and 1 deletions

View file

@ -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
View 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));
}