Contenido principal

Float Typecast

R2026b

Typecast data between unsigned integers and floating-point data types

  • Float Typecast block

Libraries:
HDL Coder / HDL Floating Point Operations

Description

The Float Typecast block typecasts the underlying bits of the input signal to the corresponding fixed-point or floating-point representation. The input and output of the block contain the same number of bits. This table shows the supported input and corresponding output data types.

Input Data TypeOutput Data Type
halfuint16
singleuint32
doubleuint64
uint32single
uint64double
uint16half

This figure shows how the block mask, behavior, and output data type change depending on the input data type.

Simulink blocks demonstrating how the block icon and output data type update depending on the input data type

Examples

Ports

Input

expand all

Input signal, specified as a scalar, vector, or matrix.

Data Types: half | single | double | uint16 | uint32 | uint64

Output

expand all

Output signal, returned as a scalar, vector, or matrix.

Data Types: half | single | double | uint16 | uint32 | uint64

Extended Capabilities

expand all

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

Version History

Introduced in R2017b

expand all