Main Content

Float Typecast

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

  • Float Typecast block

Libraries:
HDL Coder / HDL Floating Point Operations

Description

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.

Input Data TypeOutput Data Type
halfuint16
singleuint32
doubleuint64
uint32single
uint64double
uint16half

This figure shows how the block mask, behavior, and output data type changes dynamically depending on the input data type that you specify.

Shows how the output data types vary in response to changes in the input data type.

Examples

Ports

Input

expand all

Port to provide input to the block.

Data Types: singledouble | uint32 | fixed point

Output

expand all

Port to obtain calculated output from the block.

Data Types: single | double | uint32 | fixed point

Extended Capabilities

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

Version History

Introduced in R2017b