Norm.Campbell
Joined: 31 Aug 2007 Posts: 66
|
Posted: Mon Oct 15, 2007 2:45 pm Post subject: reading 4-byte reals |
|
|
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? |
|