# Fixed-point visualised: k integer bits

> Interactive fixed point with n bits and k fractional digits: multiplication by a power of two, rounding, Horner conversion, rounding error and value range.

Address: https://marckimmel.de/en/informatik/zahlenkodierungen/festkomma
Deutsche Fassung: https://marckimmel.de/informatik/zahlenkodierungen/festkomma.md

Real numbers with fixed fractional digits. Bounded absolute rounding error.

Fixed-point encoding c_(FK,k,n) encodes a nonnegative real r by multiplying r with 2^k, 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.

Useful when all relevant numbers share a similar magnitude: audio samples, sensor data on microcontrollers, deterministic game logic.

## Related

- [Number Encodings](https://marckimmel.de/en/informatik/zahlenkodierungen.md)
