Fixed-point
Real numbers with fixed fractional digits. Bounded absolute rounding error.
Configure your inputs and press Compute to see the step-by-step computation.
How it works
Fixed-point encoding cFK,k,n encodes a nonnegative real r by multiplying r with 2k, rounding to the nearest integer and storing it in n bits. n-k bits are used for the integer part, k bits for the fraction. The maximum absolute rounding error is 2-(k+1) (bounded); the relative error grows unbounded for small numbers.
Rounding error
For fixed-point encoding the absolute rounding error is bounded by a constant; the relative error grows unbounded for small numbers.
- Maximum absolute error
- 2−(k+1) = 2−5 = 0.03125
- Maximum relative error
- 1 / (|r| · 2k+1) — wächst für kleine |r| unbegrenzt
Press "Compute" to see the actual error of your current input.
When to use
Useful when all relevant numbers share a similar magnitude: audio samples, sensor data on microcontrollers, deterministic game logic.