Zero suppression
From Wikipedia, the free encyclopedia
Zero suppression is the removal of redundant zeroes from a number. This can be done for storage, page or display space constraints or formatting reasons, such as making a letter more legible.
Examples:
- 00049823 - 49823
- 7.678600000 - 7.6786
- 0032.3231000 - 32.3231
It is also a way to store a large array of numbers, where many of them are zero, by omitting the zeroes, and instead storing the indices and values of the numbers that are non-zero. It only makes sense if the extra spaced used for storing the indices (on average) is smaller than the space saved by not storing the zeroes.
Example:
- Original array: 0, 1, 0, 0, 2, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0
- Pairs of index and data: {2,1}, {5,2}, {6,5}, {10,4}