...
| Code Block | ||
|---|---|---|
| ||
short a = 533; int b = 6789; long c = 4664382371590123456L; float d = a; double e = b; double f = c; d /= 7; // d is 76.14286 e /= 30; // e is 226.3 f *= 2; // f is 9.328764743180247E18 |
Exceptions
FLP02-EX1: If it is When the programmer 's intention to have the operation intends to use integers before the conversion (for example, obviating the need to use the floor() method) it this choice should be clearly documented to help future maintainers understand that this behavior is intentional.
...
Guideline | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
FLP02-J | low | probable | low | P6 | L2 |
Automated Detection
TODOAutomated detection is not feasible in the general case. Heuristic checking may be useful.
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this guideline on the CERT website.
...