Convert type

Convert type

Changes the data type of the input object.

Input

input
A scalar, a matrix or a tensor. Accepted types depend on outputType: a scalar output type requires a scalar input type etc.
outputType
The type of the output.
roundingMode
The way floating-point values are converted to integers.

Outputs

output
The converted value.

Inherits UnaryFunctionTool.

Type of the output scalar, matrix or tensor.

Rounding and clamping modes. Rounding takes an effect only when the the input type is a floating point type and the output type is an integral type. Clamping takes an effect only when the output type is an integral type.

Enumerator
TruncateAndWrap 

Truncate the decimal part and cast the result to the output type without overflow or underflow checks.

RoundAndWrap 

Round the decimal part and and cast the result to the output type without overflow or underflow checks.

TruncateAndClamp 

Truncate the decimal part and clamp the result between minimum and maximum values of the output type to prevent spurious overflow and underflow.

RoundAndClamp 

Round the decimal part and clamp the result between minimum and maximum values of the output type to prevent spurious overflow and underflow.