IEEE-754 Floating-Point Conversion
Posted: Mon Sep 15, 2008 3:53 pm
Hey guys, I'm pulling my hair out on this one...I've been working on this for days.
I am being presented a hex value in this case 45EF7000 and the manual of the device i'm coding for says that the hex value is in "ASCII HEX IEEE FLOAT"
Now here is where the fun starts, if you look at http://babbage.cs.qc.edu/IEEE-754/32bit.html and you enter the hex value above you will get the correct number which is 7662
I for the life of me and google cannot figure out how to do this conversion in my php code. I have tried all the examples that google has offered up and they all return crazy numbers in the millions or large negative numbers.
Could anyone help with this at all...?
I am being presented a hex value in this case 45EF7000 and the manual of the device i'm coding for says that the hex value is in "ASCII HEX IEEE FLOAT"
Now here is where the fun starts, if you look at http://babbage.cs.qc.edu/IEEE-754/32bit.html and you enter the hex value above you will get the correct number which is 7662
I for the life of me and google cannot figure out how to do this conversion in my php code. I have tried all the examples that google has offered up and they all return crazy numbers in the millions or large negative numbers.
Could anyone help with this at all...?