In principle it does not matter whether you have a common floating point number (for example IEEE-754 float
or double
) or a fixed point number. Both have their limits towards very large (absolute) values and towards very small values.
A very small number (less than the smallest fixed point value not equal to zero, or the half of it, depending on rounding) will be represented as zero. Approaching the lower limit will raise the inaccuracy, because the number of available digits gets smaller.
A very large number (more than the absolut value of the largest fixed point, and a bit, depending on rounding) can not be represented.
Examples, for convenience on a decimal base, commonly numbers are on a binary base:
Let's assume you have a signed fixed point defined with 3 digits left of the decimal point and 2 digits right of it.
The smallest difference between one value and another is 0.01.
The smallest values not equal to zero are -000.01 and +000.01.
The largest values are -999.99 and +999.99.
Rounding is presumed.
A value like PI will be represented as 3.14, giving an inaccuracy of about 0.05%.
If you try to assign an absolute value smaller than 000.005 it will be represented as 0.
If you try to assign a small value like 0.12345, it will be represented as 0.12, giving an inaccuracy of just about 3%.
If you try to assign a value larger than or equal to 999.995, you can not do this. If your definition knows the concept of overflow, this will be the result.