Data Types and Scaling

Fixed-point and floating-point number representation, scaling, quantization, range, precision

Examples and How To

Cast from Doubles to Fixed Point

Provides an example based on the fxpdemo_dbl2fix model, which highlights many of the key features of the Fixed-Point Designer™ software

Use Scaled Doubles to Avoid Precision Loss

How to avoid precision loss by overriding the data types in your model with scaled doubles.

Display Port Data Types

The port display for fixed-point signals consists of three parts: the data type, the number of bits, and the scaling.


Fixed-Point Numbers in Simulink

Describes how fixed-point numbers are represented in Simulink®.

Floating-Point Numbers

Discusses the representation and manipulation of floating-point numbers

Supported Data Types

Data types supported for simulation and code generation


The dynamic range of fixed-point numbers is much less than floating-point numbers with equivalent word sizes. To avoid overflow conditions and minimize quantization errors, fixed-point numbers must be scaled.


The quantization of a real-world value is represented by a weighted sum of bits.

Range and Precision

The range of a number gives the limits of the representation, while the precision gives the distance between successive numbers in the representation. The range and precision of a fixed-point number depend on the length of the word and the scaling.

Scaled Doubles

Scaled doubles are a hybrid between floating-point and fixed-point numbers. The Fixed-Point Designer software stores them as doubles with the scaling, sign, and word length information retained.

Was this topic helpful?