kaitai_struct icon indicating copy to clipboard operation
kaitai_struct copied to clipboard

Implement 16-bit float from IEEE 754-2008

Open Theaninova opened this issue 2 years ago • 1 comments

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.

Theaninova avatar Feb 14 '23 14:02 Theaninova

https://github.com/kaitai-io/kaitai_struct_formats/pull/210 and #991 are strongly related

KOLANICH avatar Feb 14 '23 14:02 KOLANICH