Lyricdev
GitHub

LYR-RT0001

integer division by zero

panic ยท spec 03-types

An integer / or % has a zero divisor. Integer division checks its divisor in every profile; check it before dividing where zero can occur.

Program

fn ratio(a: int, b: int): int {
    return a / b;
}

fn main(): void {
    assert(ratio(1, 0) == 0);
}