Expand description
ladderz
+Expand description
ladderz
Implementations of mathematical and technical concepts in Rust.
-View the modules section for the various implementations based on the subject.
+Subjects
+The modules for currently supported subjects are:
+-
+
pre_algebra
+
Example
Here’s an example of using the ladderz crate to get the factors and factor pairs of a positive integer in sorted order.
We’ll assume you’re using Bash as your terminal.
Module ladderz::pre_algebra
source · Expand description
Various pre-algebra implementations including factor pairs, factors, multiples, and more.
-Functions
- Finds all factor pairs for a positive integer
n. - Finds all factors of a positive integer
n. - Finds all the multiples of a positive integer
nup to and includingend(in the range [n, end]). - Checks if a positive integer
xis a factor of another positive integery. - Checks if a positive integer
xis a multiple of another positive integery.
Example
+use ladderz::pre_algebra::get_factors;
+
+fn main() {
+ let x: u32 = 10;
+ println!("The factors of {x} are {:?}.", get_factors(x));
+}The factors of 10 are {1, 5, 2, 10}.
+Functions
- Finds all factor pairs for a positive integer
n. - Finds all factors of a positive integer
n. - Finds all the multiples of a positive integer
nup to and includingend(in the range [n, end]). - Checks if a positive integer
xis a factor of another positive integery. - Checks if a positive integer
xis a multiple of another positive integery.
//! # ladderz
//!
//! 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
//!
@@ -181,5 +205,21 @@
//! 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.
+///
+/// # 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;