-1
$\begingroup$

I have a hexadecimal to float converter in the form of a code by I am unable to understand as to how did they carry out the conversion.

For Ex: If I have a hexadecimal number as : 11433333; the answer I get from that function is: 145.200.

I tried several methods of conversion like these:

http://www.cs.uaf.edu/~cs301/notes/Chapter4/node13.html

http://babbage.cs.qc.edu/IEEE-754/32bit.html

There is something to do with little endian and big endian, but I am not familiar with that. None of these are giving me the output as 145.200. Could anyone explain me a way out of this please?

Cheers in advance.

  • 0
    Sorry, my bad. It is 145.200.2011-08-26

1 Answers 1

1

The mystery is resolved when you do the conversion the other way around: the IEEE representation of 145.2 is 43 11 33 3316. So some part of your code is getting the byte order mixed up.

  • 0
    IIRC, that's exactly the difference between "little endian" and "big endian". They will switch the order of bytes within a word.2015-05-06