kaitai_struct
kaitai_struct copied to clipboard
Implement 16-bit float from IEEE 754-2008
16-bit floats are used relatively often in computer graphic formats, like images and 3d files to save space.
Support through languages of course is sparing, but the 16 bit float can be converted to 32-bit through some bit shifting which is even valid in the expression language. (((value & 0x8000) << 16) | (((value & 0x7c00) + 0x1c000) << 13) | ((value & 0x03ff) << 13)
).
Some languages also support 16-bit floats, for example C++ through SSE2.
https://github.com/kaitai-io/kaitai_struct_formats/pull/210 and #991 are strongly related