COMPUTER OPERATOR

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
data:packing [2026/04/28 21:30] skanderdata:packing [2026/05/03 14:25] (current) – [Minimum required bits] skander
Line 1: Line 1:
 ====== Packing ======  ====== Packing ====== 
  
-'Packing' refers to the act of using the minimum required bits to encode information and placing these bits in a contiguously in a sequence. In other words, to not waste bits that are not needed in encoding the information. In the context of data and programming, packing is often used in creating tuples of multiple types, or POD types.+'Packing' refers to the practice of representing information using only the minimum number of bits required, and arranging those bits contiguously in memory or in a data stream. In other words, it avoids wasting unused bits when encoding values. 
 + 
 +In data representation and programming, packing is often used to combine multiple values into a compact layout. This may involve packing fields into tuples or aggregate types, especially when memory usage, cache efficiency, storage size, or binary serialisation performance matters.
  
 ===== Minimum required bits ===== ===== Minimum required bits =====
  
 +Encoding information as binary digits, or bits, requires an encoding scheme that defines how values are mapped to bit patterns and how those bit patterns are decoded back into values.
 +
 +For a finite set of possible values, the minimum fixed-width binary representation requires enough bits to uniquely encode every value. This bit width is determined by the cardinality of the value set.
  
 +<code>
 +ceil(log2(number of possible values))
 +</code>
data/packing.1777404655.txt.gz · Last modified: by skander