Hi,
Create a simple project for 56F801 in CW 8.0 and find a strange problem when converting float point to bytes. Define a union
typedef union _FloatType
{
float f;
byte b[4];
} FloatType;
then define and set
FloatType f;
f.f = 2.3f;
In debuger window, find b[0] = 0x3333, b[1] = 0x4013, b[2] = 0; b[3] = 0
Apparently b does not point to bytes. What's the problem here?
Thanks a lot.
Hi, I think it probably depends on what format the float is encoded (cfr. http://en.wikipedia.org/wiki/IEEE_754-2008 for example).
I don't know what format is used in the 56800...
Hope this helps
Bye Giacomo