https://en.wikipedia.org/wiki/Arithmetic_coding

Arithmetic coding differs from other forms of entropy encoding, such as Huffman coding, in that rather than separating the input into component symbols and replacing each with a code, arithmetic coding encodes the entire message into a single number, an arbitrary-precision fraction q where $0.0 \le q < 1.0$. It represents the current information as a range, defined by two numbers.

Example