Silverfrost Forums

Welcome to our forums

reading 4-byte reals

15 Oct 2007 1:45 #2362

Someone has sent me an ER Mapper real file, and I thought I knew how to decode it: read each lot of 4 bytes into a character*4 array, and then read the real number from the character array. It didn't give the correct number (which I can get using ER Mapper displays). (And byte swapping crashed the program.)

I then wrote out the correct number using an unformatted write; read the bytes back in; and decoded them using ichar. The 4 numbers for the 4 bytes are different to those from reading in the 4 bytes from the ER Mapper file and decoding them.

What am I doing wrong?

Do I have to go back to the IEEE specification, and do a bit dump to reconstitute the number?

14 Nov 2007 5:02 #2440

Do you have a code fragment?

Please login to reply.