# Function ladderz::pre_algebra::is_composite

source ·

    pub fn is_composite(n: u32) -> bool

Expand description

Checks if a positive integer `n` is a composite number.

A composite number is a positive integer that is evenly divisible by a positive integer other than 1 and itself.

## Examples

    use ladderz::pre_algebra::is_composite;

    assert!(!is_composite(1)); // 1 is not a composite number
    assert!(!is_composite(2)); // 2 is not a composite number
    assert!(is_composite(4)); // 4 is a composite number
    assert!(!is_composite(7)); // 7 is not a composite number