Remove code from floating-point to integer conversions that wraps out-of-range values
Control generation of wrapping code that handles out-of-range floating-point to integer conversion values
Model Configuration Pane: Code Generation / Optimization
Description
The Remove code from floating-point to integer conversions that wraps out-of-range values parameter specifies whether to generate wrapping code that handles out-of-range floating-point to integer conversion results.
Settings
off
(default) | on
- 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.
Recommended Settings
Application | Setting |
---|---|
Debugging | Off |
Traceability | Off |
Efficiency | On (execution, ROM), No impact (RAM) |
Safety precaution | No impact |
Programmatic Use
Parameter: EfficientFloat2IntCast |
Type: character vector |
Value: 'on' | 'off' |
Default: 'off' |
Version History
Introduced in R2006a