hi i have the following hex string 40 E3 4E DA 04 2B FE 7C and i need to convert this to 39541.813009259260. I believe this is a hex to ieee float conversion. I thought that it was a case of viewing the hex in binary format the inverting the bits but it isnt giving me the correct answer. Does anyone know how to do this correctly?

thanks

union {
  double d;
  unsigned char hex[8];
} x;

Assign you 8 hex bytes to x.hex[0] through x.hex[7]. Whether 40 say goes at the start or the end will need to be determined.
Then examine x.d for the floating point value.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.