I am use the CCS compiler to microcontroller and I am taking a frame of reads from a RTU in hexadecimal of 2 bytes (16 bist) which I store in an int16 array, these stored data are floating point numbers in IEEE 754 half-precision representation, I need to perform arithmetic operations with these reads and the only one way to do them is to convert these numbers to float:
Example:
Number float IEEE 754
A 12.50 0x4A40
B 11.75 0x49E0
A+B 24.25 0x4E10
if I did the operation as simple hexadecimal sums A + B = 0x4A40 + 0x49E0 = 0x9420 which is totally different from the value obtained if I work with its float representation 0x4E10, I need the conversion algorithms to port it to the compiler that I use