Main Content

Float Typecast

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

  • Library:
  • HDL Coder / HDL Floating Point Operations

  • Float Typecast block

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.

Ports

Input

expand all

Port to provide input to the block.

Data Types: single | double | 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™.

Introduced in R2017b