Main Content

Negative Fraction Length

A negative fraction length occurs when the input value of a fi object contains trailing zeros before the decimal point. For example,

x = fi(16000,1,8)

produces a signed fixed-point number with a word length of 8 bits and best precision fraction length.

x = 


          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 8
        FractionLength: -7

View the binary representation of x.


There are seven implicit zeros at the end of this number before the binary point because the fraction length of x is -7.

Convert from binary to decimal the binary representation of x with seven zero bits appended to the end.

ans =


The result is the real world value of x.

You can also find the real world value using the equation Real World Value = Stored Integer Value × 2Fraction Length.

Start by finding the stored integer of x.

Q = storedInteger(x)
Q =


Use the stored integer to find the real world value of x.

real_world_value = double(Q) * 2^-x.FractionLength
real_world_value =


See Also