encoding/cbor/utils/float_utils library

Float encoding/decoding for CBOR: converts a Dart double to/from the smallest IEEE 754 format (16/32/64-bit) that holds it exactly, and back again.

Independent implementation: rather than manually decoding a double's IEEE 754 bit pattern into (mantissa, exponent) and reasoning about exponent-bias arithmetic to determine whether a smaller format can hold a value exactly, this just tries encoding to the smaller format and decoding back, comparing the result to the original - if they're equal, the smaller format is exact. Much simpler to get right (no mantissa/exponent bias arithmetic to verify by hand), and it reuses the same encode/decode logic needed anyway to actually produce the CBOR bytes, rather than duplicating the bit-width reasoning in a second, separate form.

Classes

FloatUtils

Enums

FloatLength
The three IEEE 754 binary floating-point formats CBOR can use.