ex)
union BitConvert{ float f; unsigned long ul; }; unsigned char a,b,c,d; a = buffer[0]; b = buffer[1]; c = buffer[2]; d = buffer[3]; BitConvert EX; EX.ul = (a << 24) | (b << 16) | (c << 8) | d; // or EX.ul = (d << 24) | ( c << 16) | (b << 8) | a; (It is depend on your plaform.)
There is float value in the "EX.f".
Thank you~. ^^
No comments:
Post a Comment