Skip to content

XOR stores each float as the bitwise XOR of its 64-bit pattern with the pattern of the previous value. Equal neighbours give zero. It is codec id 2 in FloatCol.

Field Encoding Meaning
codec u8 2
xors IntCol bits[i] xor bits[i-1] for each value, with bits[-1] = 0

The number of values is the count of the IntCol. See Column container types for the IntCol layout.

  1. Read the codec byte (2) and the IntCol.
  2. Let prev = 0.
  3. For each stored word x, let bits = prev xor x, emit the f64 with these bits, and set prev = bits.

Derived by hand, not from a real file. Let b be the bit pattern of 1.0 and take the two values 1.0, 1.0. The stored words are b xor 0 = b and b xor b = 0. Decoding: prev = 0, first word gives b, second word gives b xor 0 = b. Both values are 1.0.

  • The IntCol is a valid IntCol.
  • Its count is within its limit.

See How writers choose a codec.