...
Automated detection of floating-point arithmetic is straightforward. However, determining which code suffers from insufficient precision is not feasible in the general case. Heuristic checks, such as flagging floating-point literals that cannot be represented precisely, could be useful.
Tool | Version | Checker | Description |
---|---|---|---|
Parasoft Jtest | 9.5 | PB.NUM.UBD | Implemented |
Related Guidelines
FLP02-C. Avoid using floating-point numbers when precise computation is needed | |
FLP02-CPP. Avoid using floating point numbers when precise computation is needed | |
Floating-Point Arithmetic [PLF] |
...