I\'m programming in C++. I need to convert a 24-bit signed integer (stored in a 3-byte array) to float (normalizing to [-1.0,1.0]).
The platform is MSVC++ on x86 (wh
Works for me:
float convert(const char* stream) { int fromStream = (0x00 << 24) + (stream[2] << 16) + (stream[1] << 8) + stream[0]; return (float)fromStream; }