If the denominator to a division or modulo operation is zero it would result in a fatal error.

## Noncompliant Code Example

void test_divide() {
int z = 0;
if (unknown()) {
// ..
z = 3;
} else {
// ..
}
z = 1 / z; // Noncompliant, possible division by zero
}

## Compliant Solution

void test_divide() {
int z = 0;
if (unknown()) {
// ..
z = 3;
} else {
// ..
z = 1;
}
z = 1 / z;
}

## See

- MITRE, CWE-369 - Divide by zero
- CERT, NUM02-J. - Ensure that division and remainder operations do not result in
divide-by-zero errors
- CERT, INT33-C. - Ensure that division and remainder operations do not result in
divide-by-zero errors