Recently, I ran in to a situation where a floating point value (represent current) was being converted to a byte value before being sent off in a status message. Thus, any calculations on the other side were being done with whole values (1, 2, 42, etc.). I was asked if the precision could be increased (adding a decimal place) and realized “you can’t get there from here.”
This made me wonder how much could be done with an 8-bit floating point representation. A quick web search led me to this article:
I also found a few others discussion other methods of representing a floating point value with only 8-bits.
Now I kinda want to code up such a routine in C and do some tests to see if it would be better than our round-to-whole-number approach.
Has anyone reading this already done this? I think it would be a fun way to learn more about how floating point representation (sign, mantissa, exponent) works.
But it doesn’t seem very useful.