Data Type Conversion and Casting
Data type conversion and casting refers to changing from one data type to another. Fixed-Point Designer™ lets you create and optimize data types that meet numerical accuracy requirements and target hardware constraints.
Topics
- Parameter and Signal Conversions
Conversions of data types of parameters and signals in Simulink® simulations.
- Conversions and Arithmetic Operations
Example highlighting how the data types are converted and arithmetic operations are performed on inputs and parameters in the Simulink software.
- Fixed-Point Arithmetic
Addition, subtraction, multiplication, casts, modulo, and two’s complement arithmetic.
- Cast from Doubles to Fixed Point
Simulate a continuous signal with fixed-point data types using Fixed-Point Designer to adjust scaling, rounding, and overflow handling.
- Display Fixed-Point Port Data Types and Values
Display signal data types and view signal values in different data type representations.
- fi Objects and C Integer Data Types
Comparison of ANSI C integer data type ranges, conversions, and exception handling with those of
fiobjects. - Cast fi Objects
Information on casting
fiobjects.
Troubleshooting
Resolve Unexpected Values from Data Type Conversion
Troubleshoot settings to improve accuracy of fixed-point calculations.
Understand Unexpected Results from Data Type Conversion
This example shows how precision loss occurs in fixed-point Simulink models.
