# get_multiples_in_range in ladderz::pre_algebra - Rust
Finds all the multiples of a positive integer `n` up to and including `end` (in the range [n, end]).

# 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]).

Returns a `HashSet<u32>` containing all the multiples of a positive integer `n` 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;

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

        let result: HashSet<u32> = get_multiples_in_range(3, 15);
        let expected: HashSet<u32> = [3, 6, 9, 12, 15].into();
        assert_eq!(result, expected);
    }