E5002 Runtime Errors

modulo-by-zero

cannot modulo by zero

When this occurs

`x % 0`

Example error message

error[E5002]: modulo by zero

How to fix

Check that the divisor is not zero before using modulo.

Related errors