A loop counter shall not have essentially floating type
A loop counter shall not have essentially floating type.
When using a floating-point loop counter, accumulation of rounding errors can result in a mismatch between the expected and actual number of iterations. This rounding error can happen when a loop step that is not a power of the floating point radix is rounded to a value that can be represented by a float.
Even if a loop with a floating-point loop counter appears to behave correctly on one implementation, it can give a different number of iteration on another implementation.
If the for index is a variable symbol, Polyspace® checks
that it is not a float.
If you expect a rule violation but do not see it, refer to the documentation of Polyspace Code Prover™ or Polyspace Code Prover Server™.
| Group: Control Statement Expressions |
| Category: Required |
| AGC Category: Advisory |