http://qs1969.pair.com?node_id=208692


in reply to Extracting IEEE 754 floating point numbers

Thanks for all your replies. I tried printing out the value of 1.0, packed as a float, then unpacked in hex. I got the value 0000803f. Then I tried the same with the encoded value sent from my application, and got 3f800000. This looked like it could be the little endian/big endian problem, so I tried the suggested conversion
unpack "f*", pack "N*", unpack "V*", $_[0];
which did the trick. I have one last query - does the order of the bits matter as to whether the format qualifies as a IEEE 754 floating point number? This is quite a concern, as the application that was causing the trouble is a test suite for a particular standard (which specified IEEE 754 as the floating point format), so I don't want to code to this application if it is wrong!

Once again, thank you for all your suggestions.