This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Float Typecast

Typecast a floating-point type to an unsigned integer or vice versa

  • Library:
  • HDL Coder / HDL Floating Point Operations / Float Typecast


The block casts the underlying bits of the input to the corresponding fixed-point or floating point representation. The input and output of the block contain the same number of bits. This figure shows how the block mask, behavior, and output data type changes dynamically depending on the input data type that you specify.



expand all

Port to provide input to the block.

Data Types: single | double | uint32 | fixed point


expand all

Port to obtain calculated output from the block.

Data Types: single | double | uint32 | fixed point

Block Characteristics

Data Types

double | single | base integer | fixed point | bus

Sample Time


Direct Feedthrough


Multidimensional Signals


Variable-Size Signals


Zero-Crossing Detection


Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Fixed-Point Conversion
Convert floating-point algorithms to fixed point using Fixed-Point Designer™.

See Also


Introduced in R2017b