Cast 64-bit integer types to an equivalent
cast64BitIntToFi functions to cast integer data types in your code
Create a variable with a signed 16-bit integer data type. Cast the variable to an
fi object using the
u = int16(25); y1 = castIntToFi(u)
y1 = 25 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 0
fi object has the same word length and signedness as
the input, and zero fraction length.
cast64BitIntToFi function casts only 64-bit integer data
types to an equivalent
fi object. All other input data types retain
their data type.
In this example, because the input is not an
uint64 data type, the output remains an
y2 = cast64BitIntToFi(u)
y2 = int16 25
When you pass an
int64 into the
cast64BitIntToFi function, the output is a
object with a 64-bit word length and zero fraction length.
u = int64(25); y3 = castIntToFi(u)
y3 = 25 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 64 FractionLength: 0
u— Numeric input
Numeric input array, specified as a scalar, vector, matrix, or multidimensional array.
Complex Number Support: Yes
y— Numeric output
Numeric output, returned as a scalar, vector, matrix, or multidimensional array with the same value and dimensions as the input.
When the data type of
u is a 64-bit integer type, the output is
fi object with a 64-bit word length, fraction length of zero, and the
same signedness as the input. Otherwise, the output has the same data type as the