# Function ladderz::pre_algebra::unit1::is_multiple

source ·

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

Expand description

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

## Challenge

Write a program that determines whether one positive integer is a multiple of another.

## Description

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

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

## Arguments

- `x` - The positive integer to determine whether it is a multiple of `y` or not.
- `y` - The positive integer for which the multiple check of `x` is performed.

## Returns

`true` if `x` is a multiple of `y`, `false` otherwise.

## Examples

    use ladderz::pre_algebra::unit1::is_multiple;

    fn main() {
        assert!(is_multiple(16, 2)); // 16 is a multiple of 2
        assert!(!is_multiple(16, 3)); // 16 is not a multiple of 3
    }