...
Automated detection of floating-point arithmetic is straight forward. 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.
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] |
...
Item 48. Avoid | |
Puzzle 2. Time for a change | |
| |
[IEEE 754] |
|
[JLS 2005] |
...
...
...