Remove code from floating-point to integer conversions with saturation that maps NaN to zero
Description
Remove code that handles floating-point to integer conversion results for
NaN
values.
Category: Optimization
Settings
Default: On
On
Removes code when mapping from
NaN
to integer zero occurs. 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 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 selected 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 mapping from
NaN
to integer zero occurs. 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 producing results that do not match simulation in the case of
NaN
values.Selecting this check box affects code generation results only for
NaN
values and cannot cause code generation results to differ from simulation results for other values.
Dependencies
This parameter requires a Simulink® Coder™ license.
For ERT-based targets, this parameter is enabled when you select the floating-point numbers and non-finite numbers check boxes in the Code Generation > Interface pane.
Command-Line Information
Parameter:
EfficientMapNaN2IntZero |
Value:
'on' | 'off' |
Default:
'on' |
Recommended Settings
Application | Setting |
---|---|
Debugging | Off |
Traceability | Off |
Efficiency | On |
Safety precaution | No recommendation |