# Function ladderz::pre_algebra::is_factor

source ·

    pub fn is_factor(x: u32, y: u32) -> bool

Expand description

Checks if a positive integer `x` is a factor of another positive integer `y`.

A factor of `y` is a positive integer `x` where `y` is evenly divisible by `x` (i.e., `y % x == 0`).

## Examples

    use ladderz::pre_algebra::is_factor;

    assert!(is_factor(2, 16)); // 2 is a factor of 16
    assert!(!is_factor(3, 16)); // 3 is not a factor of 16

## Note

This function determines if `x` is a factor of `y` by checking if `y` is evenly divisible by `x` (i.e., `y % x == 0`).