Stored integer value of fi object
st_int = storedInteger(f)
st_int = storedInteger(f) returns the stored integer value of fi object f.
Fixed-point numbers can be represented as
or, equivalently as
The stored integer is the raw binary number, in which the binary point is assumed to be at the far right of the word.
Data Types: int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
The returned stored integer value is the smallest built-in integer data type in which the stored integer value f fits. Signed fi values return stored integers of type int8, int16, int32, or int64. Unsigned fi values return stored integers of type uint8, uint16, uint32, or uint64. The return type is determined based on the stored integer word length (WL):
WL ≤ 8 bits, the return type is int8 or uint8.
8 bits < WL ≤ 16 bits, the return type is int16 or uint16.
16 bits < WL ≤ 32 bits, the return type is int32 or uint32.
32 bits < WL ≤ 64 bits, the return type is int64 or uint64.
Find the stored integer values for two fi objects. Use the class function to display the stored integer data types.
x = fi([0.2 0.3 0.5 0.3 0.2]); in_x = storedInteger(x); c1 = class(in_x) numtp = numerictype('WordLength',17); x_n = fi([0.2 0.3 0.5 0.3 0.2],'numerictype',numtp); in_xn = storedInteger(x_n); c2 = class(in_xn)