Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

jc_0481: Use of hard equality comparisons for floating point numbers in Stateflow

ID: Title

jc_0481: Use of hard equality comparisons for floating point numbers in Stateflow

Priority

Recommended

Scope

MAAB

MATLAB Versions

All

Prerequisites

None

Description

  • Do not use hard equality comparisons (Var1 == Var2) with two floating-point numbers.

  • If a hard comparison is required, a margin of error should be defined and used in the comparison (LIMIT, in the example).

  • Hard equality comparisons may be done between two integer data types.

Correct

Incorrect

Rationale

  • Verification and Validation

  • Code Generation

Last Changed

V2.0

Model Advisor Check

By Task > Modeling Standards for MAAB > Stateflow > Check for equality operations between floating-point expressions in Stateflow charts

For check details, see Check for equality operations between floating-point expressions in Stateflow charts (Simulink Verification and Validation).

Introduced in R2010a

Was this topic helpful?