Main Content

Remove code from floating-point to integer conversions that wraps out-of-range values


Remove wrapping code that handles out-of-range floating-point to integer conversion results.

Category: Optimization


Default: Off


Removes code when out-of-range conversions occur. Select this check box if code efficiency is critical to your application and the following conditions are true for at least one block in the model:

  • Computing the outputs or parameters of a block involves converting floating-point data to integer or fixed-point data.

  • The Saturate on integer overflow check box is cleared in the Block Parameters dialog box.


Execution of generated code might not produce the same results as simulation.


Results for simulation and execution of generated code match when out-of-range conversions occur. The generated code is larger than when you select this check box.


  • Selecting this check box reduces the size and increases the speed of the generated code at the cost of potentially producing results that do not match simulation in the case of out-of-range values.

  • Selecting this check box affects code generation results only for out-of-range values and cannot cause code generation results to differ from simulation results for in-range values.


This parameter requires a Simulink® Coder™ license.

Command-Line Information

Parameter: EfficientFloat2IntCast
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

EfficiencyOn (execution, ROM), No impact (RAM)
Safety precaution

No impact

Related Topics