E1092: constant remainder by zero

View source

A remainder by zero has no result.

A remainder by zero has no result. When the divisor is a literal zero, or an expression that the compiler evaluates to zero, the failure is certain, so it is reported while compiling instead of trapping when the program runs (ADR-0044). A divisor that is only known at run time traps when it is zero. The error points at the divisor.

Example

actus
verb main() {
    erg n: Int = 10;
    erg m = n % 0;
}

Fix

Use a divisor that is not zero.

actus
verb main() {
    erg n: Int = 10;
    erg m = n % 3;
}

Run actus explain E1092 in your terminal to read this entry offline. Browse Ownership & types or all error codes.