Elias gamma code is a universal code encoding the positive integers. To code a number:
An equivalent way to express the same process:
The code begins: 1 1 2 010 3 011 4 00100 5 00101 6 00110 7 00111 8 0001000 9 0001001 10 0001010 11 0001011 12 0001100 13 0001101 14 0001110 15 0001111 16 000010000 17 000010001
To decode an Elias gamma-coded integer:
Gamma coding is used in applications where the largest encoded value is not known ahead of time, or to compress data in which small values are much more frequent than large values.
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Elias gamma coding".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world