Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This compliant solution uses an integer loop counter from which the floating-point value is derived. Additionally, it uses a double to ensure that the available precision suffices to represent the desired values. The solution also runs in FP-strict mode to guarantee portability of its results. See NUM06 NUM53-J. Use the strictfp modifier for floating-point calculation consistency across platforms for more information.

Code Block
bgColor#ccccff
for (int count = 1; count <= 10; count += 1) {
  double x = 100000000.0 + count;
  /* ... */
}

...

Automated detection of floating-point loop counters is straightforward.

Related Guidelines

...