Description
Integers and Decimal should never be divided by the constant 0 as this causes a DivideByZeroException at runtime.Bad Code
Good Code
Properties
- Category: Reliability
- Severity: Error
- Enabled by default: True
- Code fix available: False
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Integers and Decimal should never be divided by the constant 0
int result = value / 0;
int result = divisor != 0 ? value / divisor : 0;
dotnet_diagnostic.AL0003.severity = warning
Was this page helpful?
