Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: wordsmithing

Incautious use of integer arithmetic to calculate a value for assignment to a floating-point variable can lead to loss of information. Recall, for example, that integer arithmetic always produces integral results, consequently losing information about any possible fractional remainder. Furthermore, there can be loss of precision when converting integers to floating-point values; see guideline FLP10-J. Beware of precision loss when casting converting primitive integers to floating-point for additional information. Correct programming of expressions that mix integer and floating point operations or values requires careful consideration.

...