[−][src]Trait binjs_io::bytes::float::ReadVarFloat
Utility for manipulating of varfloats
, a somewhat optimized representation of floats.
This format is designed to help the most common floating point numbers (fairly short integers) take fewer bytes.
Instead of always fitting in 64 bits, varfloats are represented as follows:
- null is represented as VARNUM_NULL (24 bits);
- floats with an i32 value are transmuted to u32s and represented as signed varnums (8 to 40 bits, where numbers in [-63, 63] fit in 8 bits);
- other float values are prefixed with VARNUM_PREFIX_FLOAT (16 bits), then represented with the usual 64 bits.