MISRA.FOR.COND.FLTFloating point object is used in the condition section of a 'for' loop. MISRA-C Rule 13.4 (required): The controlling expression of a for statement shall not contain any objects of floating type.This rule is also covered by MISRA.FOR.COUNTER.FLT and MISRA.FOR.COUNTER.MANY. The controlling expression may include a loop counter, whose value is tested to determine termination of the loop. Floating-point variables shall not be used for this purpose. Rounding and truncation errors can be propagated through the iterations of the loop, causing significant inaccuracies in the loop variable, and possibly giving unexpected results when the test is performed. For example the number of times the loop is performed may vary from one implementation to another, and may be unpredictable. See also Rule 13.3. |