Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Edited by sciSpider v2.4 (sch jbop) (X_X)@==(Q_Q)@

...

It may be desirable to have the operation take place as integers before the conversion (obviating the need for a trunc() call, for example). If that is done, it should be clearly documented to help future maintainers understand the intent of the code.

...

Noncompliant Code Example

In this non-compliant noncompliant code, the floating point variables d, e, and f are not initialized correctly because the operations take place before the values are converted to floating point values and hence the results are truncated to the nearest integer or may overflow. Consequently, the division and multiplication operations take place on integers and then get converted to floating point.

...