SmallFloat
Floating point numbers smaller than 32 bits.
Functions
byteToFloat(b, mantissaBits=3, zeroExponent=15)
Decode values that have been encoded with .intToByte4.
Converts an 8 bit float to a 32 bit float.
Converts a 32 bit float to an 8 bit float.
Values less than zero are all mapped to zero.
Values are truncated (rounded down) to the nearest 8 bit value.
Values between zero and the smallest representable value are rounded up.
floatToByte(b, mantissaBits=3, zeroExponent=15)
smallest non-zero value = 5.820766E-10
largest value = 7.5161928E9
epsilon = 0.125
Decode values encoded with .longToInt4.
Encode an integer to a byte. It is built upon .longToInt4 and leverages the fact that longToInt4(Integer.MAX_VALUE) is less than 255 to encode low values more accurately.
Float-like encoding for positive longs that preserves ordering and 4 significant bits.