Read half precision float (float16 IEEE 754r) binary data in matlab
- by Michael
you have been a great help last time, i hope you can give me some advise this time, too.
I read a binary file into matlab with bit16 (format = bitn) and i get a string of ones and zeros.
bin = '1 00011 1111111111' (16 bits: 1. sign, 2-6. exponent, 7-16. mantissa)
According to ftp://www.fox-toolkit.org/pub/fasthalffloatconversion.pdf it can be 'converted' like
out = (-1)^bin(1) * 2^(bin(2:6)-15) * 1.bin(7:16) [are exponent and mantissa still binary?]
Can someone help me out and tell me how to deal with the 'eeeee' and '1.mmmmmmmmmm' as mentioned in the pdf, please.
Thanks a lot!
Michael