Fixed-Point Blockset | ![]() ![]() |
Example: Limitations on Precision and Errors
Fixed-point variables have a limited precision because digital systems represent numbers with a finite number of bits. For example, suppose you must represent the real-world number 35.375 with a fixed-point number. Using the encoding scheme described in Scaling, the representation is
The two closest approximations to the real-world value are Q = 13 and Q = 14.
In either case, the absolute error is the same:
For fixed-point values within the limited range, this represents the worst-case error if round-to-nearest is used. If other rounding modes are used, the worst-case error can be twice as large:
![]() | Padding with Trailing Zeros | Example: Maximizing Precision | ![]() |