Main Content

Check comparison of floating point types in Simulink

Check ID: mathworks.jmaab.jc_0800

Guideline: jc_0800: Comparing floating-point types in Simulink®

Description

Checks if equivalence comparison is done on floating-point numbers.

This check applies to the following blocks:

  • Relational Operator

  • Compare To Zero

  • Compare To Constant

This check requires a Simulink Check™ license.

Check Parameterization

This check does not include sub-checks because the MAB modeling guideline provides only one sub ID.

For reference, the MAB guideline sub ID(s) that are recommended for use by the NA-MAAB and JMAAB modeling standards organizations are:

  • NA-MAAB — a

  • JMAAB — a

Results and Recommended Actions

ConditionRecommended Action
One or more instances of equivalence comparison for floating-point numbers is observed.Make sure to avoid the use of equivalence comparisons for floating-point numbers.

Capabilities and Limitations

  • Does not run on library models.

  • Analyzes content in masked subsystems. By default, the input parameter Look under masks is set to graphical.

  • Analyzes content of library-linked blocks. By default, the input parameter Follow links is set to on.

  • Allows exclusions of blocks and charts.