# Function ladderz::pre_algebra::get_multiples_in_range

source ·

    pub fn get_multiples_in_range(n: u32, end: u32) -> HashSet<u32>

Expand description

Finds all the multiples of a positive integer `n` up to and including `end` (in the range [n, end]).

A multiple of `n` is a positive integer `num` where `num` is evenly divisible by `n` (i.e., `num % n == 0`).

## Examples

    use ladderz::pre_algebra::get_multiples_in_range;
    use std::collections::HashSet;

    let result: HashSet<u32> = get_multiples_in_range(2, 10);
    let expected: HashSet<u32> = [2, 4, 6, 8, 10].into();
    assert_eq!(result, expected);