2020-12-21 15:38:52 +01:00
|
|
|
If the denominator to a division or modulo operation is zero it would result in a fatal error.
|
|
|
|
|
2021-02-02 15:02:10 +01:00
|
|
|
|
2021-01-27 13:42:22 +01:00
|
|
|
When working with ``++double++`` or ``++float++``, no fatal error will be raised, but it will lead to unusual result and should be avoided anyway.
|
2020-12-21 15:38:52 +01:00
|
|
|
|
2021-02-02 15:02:10 +01:00
|
|
|
|
2021-01-27 13:42:22 +01:00
|
|
|
This rule supports primitive ``++int++``, ``++long++``, ``++double++``, ``++float++`` as well as ``++BigDecimal++`` and ``++BigInteger++``.
|
2020-12-21 15:38:52 +01:00
|
|
|
|
|
|
|
include::../noncompliant.adoc[]
|
|
|
|
|
|
|
|
include::../compliant.adoc[]
|
|
|
|
|
2021-09-21 15:40:35 +02:00
|
|
|
== See
|
|
|
|
|
2022-04-07 08:53:59 -05:00
|
|
|
* https://cwe.mitre.org/data/definitions/369[MITRE, CWE-369] - Divide by zero
|
2021-09-21 15:40:35 +02:00
|
|
|
* https://wiki.sei.cmu.edu/confluence/x/CTZGBQ[CERT, NUM02-J.] - Ensure that division and remainder operations do not result in divide-by-zero errors
|
|
|
|
* https://wiki.sei.cmu.edu/confluence/x/ftYxBQ[CERT, INT33-C.] - Ensure that division and remainder operations do not result in divide-by-zero errors
|
2021-06-02 20:44:38 +02:00
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
2021-09-20 15:38:42 +02:00
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../message.adoc[]
|
|
|
|
|
|
|
|
include::../highlighting.adoc[]
|
|
|
|
|
2021-06-08 15:52:13 +02:00
|
|
|
'''
|
2021-06-02 20:44:38 +02:00
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
2021-06-03 09:05:38 +02:00
|
|
|
endif::env-github,rspecator-view[]
|