...
Code Block |
---|
double x, y, z; /* ... */ x = (x * y) * z; //* not equivalent toxto x *= y * z; */ z = (x - y) + y ; //* not equivalent to tozz = x; */ z = x + x * y; //* not equivalent to tozz = x * (1.0 + y); */ y = x / 5.0; //* not equivalent to toyy = x * 0.2; */ |
Risk Assessment
Failing to understand the limitations in precision of floating point represented numbers and the implications of this on the arrangement of expressions can cause unexpected arithmetic results.
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
FLP01-A | 1 (low) | 2 (probable) | 2 (medium) | P4 | L3 |
...