Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: REM cost reform

...

Using floating-point representations when precise computation is required can result in a loss of precision and incorrect values.

Rule

Severity

Likelihood

Detectable

RepairableRemediation Cost

Priority

Level

NUM04-J

Low

Probable

No

NoHigh

P2

L3

Automated Detection

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.

ToolVersionCheckerDescription
Parasoft Jtest
Include Page
Parasoft_V
Parasoft_V
PBCERT.NUMNUM04.UBDDo not use "float" and "double" if exact answers are required

...

...