A negative fraction length occurs when the input value of a
contains trailing zeros before the decimal point. For example,
x = fi(16000,1,8)
produces a fixed-point number with the specified signedness and word length, and best precision fraction length.
x = 16000 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 8 FractionLength: -7
View the binary representation of
There are seven implicit zeros at the end of this number before
the binary point because the fraction length of
Convert from binary to decimal the binary representation of
seven zero bits appended to the end.
ans = 16000
The result is the real world value of
You can also find the real world value using the equation .
Start by finding the stored integer of
Q = storedInteger(x)
Q = 125
Use the stored integer to find the real world value of
real_world_value = double(Q) * 2^-x.FractionLength
real_world_value = 16000