Encode float as int
Posted on 2007-11-23
I am integrating an existing protocol, that does not have support for floats, but only 16 bit unsigned shorts.
Seeing the values I want to encode are really small (max =30), I thought to use the 8 MSB for the integer part, and the 8 LSB for the fractal part.
The problems arise however as to how do I encode 3.5 differently then 3.05
Any ideas anyone?