Documentation

Float Typecast

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

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

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. 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

Block Characteristics

Data Types

double | single | base integer | fixed point | bus

Sample Time

Inherit

Direct Feedthrough

Yes

Multidimensional Signals

Scalar

Variable-Size Signals

Yes

Zero-Crossing Detection

No

Extended Capabilities

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

Fixed-Point Conversion
Design and simulate fixed-point algorithms using Fixed-Point Designer™.

See Also

Functions

Introduced in R2017b

Was this topic helpful?