Function tantivy_common::f64_to_u64
source · [−]Expand description
Maps a f64
to u64
For simplicity, tantivy internally handles f64
as u64
.
The mapping is defined by this function.
Maps f64
to u64
in a monotonic manner, so that bytes lexical order is preserved.
This is more suited than simply casting (val as u64
)
which would truncate the result
Reference
Daniel Lemire’s blog post explains the mapping in a clear manner.