Math Experts Question
Posted: Thu Aug 26, 2004 1:38 pm
I am trying to convert some files from binary, to plain text.
I have no documentation on the file format of the binary files, but I do have examples to use of both the binary file, and it's text equavalent.
OK, the first filetype went fine - by comparing the two files, I was able to work out the file format, what parts converted to asci equavalents, what parts were integer numbers, and which were floats.
Now, I'm looking at the second file type, but in addition to asci text, integers, and floats, I find some numbers like these:
-2.62766e-012
-5.88894e-005
What the heck are those? More importantly, how would I convert them from a hex number in the file to text output like that?
I load the whole binary file into memory, then I read the floats by PeekF into a float variable, the integers by PeekL into a long variable.
How would I read this type of number? And print it in that format as above?
I have no documentation on the file format of the binary files, but I do have examples to use of both the binary file, and it's text equavalent.
OK, the first filetype went fine - by comparing the two files, I was able to work out the file format, what parts converted to asci equavalents, what parts were integer numbers, and which were floats.
Now, I'm looking at the second file type, but in addition to asci text, integers, and floats, I find some numbers like these:
-2.62766e-012
-5.88894e-005
What the heck are those? More importantly, how would I convert them from a hex number in the file to text output like that?
I load the whole binary file into memory, then I read the floats by PeekF into a float variable, the integers by PeekL into a long variable.
How would I read this type of number? And print it in that format as above?