Main Content

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

Description

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

Category: Optimization

Settings

Default: Off

On

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.

Caution

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

Off

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.

Tips

  • 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.

Dependency

This parameter requires a Simulink® Coder™ license.

Command-Line Information

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

Recommended Settings

ApplicationSetting
DebuggingOff
TraceabilityOff
EfficiencyOn (execution, ROM), No impact (RAM)
Safety precaution

No impact

Related Topics