Module ladderz::pre_algebra

source ·
Expand description

Various pre-algebra implementations including factor pairs, factors, multiples, and more.

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 n up to and including end (in the range [n, end]).
  • Checks if a positive integer x is a factor of another positive integer y.
  • Checks if a positive integer x is a multiple of another positive integer y.