I\'m trying to re-construct a 32-bit floating point value from an eeprom.
The 4 bytes in eeprom memory (0-4) are : B4 A2 91 4D
and the PC (VS Studio) recon
The safest way, and due to compiler optimization also as fast as any other, is to use memcpy:
memcpy
uint32_t dword = 0x4D91A2B4; float f; memcpy(&f, &dw, 4);
Demo: http://ideone.com/riDfFw