jc_0481: Use of hard equality comparisons for floating point numbers in Stateflow
Control Algorithm Modeling Guidelines - Using MATLAB®, Simulink®, and Stateflow®
Sub ID Recommendations
NA-MAAB — a
JMAAB — a
Sub ID a
These equality comparison operators shall not be used in floating-point operands:
Equality comparison operators are not used in floating-point operands.
Equality comparison operator
== is used in
Sub ID a:
Due to the nature of the floating-point data type, as it contains an error, the result of the equivalence comparison operation may be false when it was expected to be true.
Model Advisor check: Check usage of floating-point expressions in Stateflow charts (Simulink Check)
Introduced in R2020a