pub fn rot54(value: u64) -> u64
Available on crate features
std
and miniz
only.Expand description
The rot54 operation is intended to exploit the ordered entropy of a float mantissa. Most of the zero values from the mantissa will be in the LSBs. Rot54 is therefor:
Float: 0xEEE_MMMMMMMMMMMMMu64 = 0x00_0ABBCCDDEEFFGG
Rot54: 0x00GGFFEEDDCCBB0A
A value like 0.25f64
is encoded as 0x3FD0000000000000
if you call f64::to_bits
. The rot54
operation rotates it to 0xD03F
- which usually encodes much nicer.