double
-
I am trying to parse dbf file. I was not able to open it via ODBC so I do direct reading from it. It is dBase 7 I have problem with double data type :-( Structure description said "O" Double 8 bytes - no conversions, stored as a double. http://www.dbase.com/KnowledgeBase/int/db7\_file\_fmt.htm But it is not IEEE Standard 754 i guess and I just wonder how this double is stored in memory and how to read it or decode. For example: -0.48 is stored: 21 47 AE 1F FF FF FF C0 and +0.48 is stored: DE B8 51 E0 00 00 00 C0 It is almost like IEEE 754, numbers bigger than 1 works fine 41.84 is 44 EB 85 20 00 00 00 40 if read in order (last byte is first) 40 44 EB 85 20 00 00 00 but where is the different? Does anyone know what I am talking about :-) Is there any memory specification or library for floating point in dBase? Thank you
viliam
-
I am trying to parse dbf file. I was not able to open it via ODBC so I do direct reading from it. It is dBase 7 I have problem with double data type :-( Structure description said "O" Double 8 bytes - no conversions, stored as a double. http://www.dbase.com/KnowledgeBase/int/db7\_file\_fmt.htm But it is not IEEE Standard 754 i guess and I just wonder how this double is stored in memory and how to read it or decode. For example: -0.48 is stored: 21 47 AE 1F FF FF FF C0 and +0.48 is stored: DE B8 51 E0 00 00 00 C0 It is almost like IEEE 754, numbers bigger than 1 works fine 41.84 is 44 EB 85 20 00 00 00 40 if read in order (last byte is first) 40 44 EB 85 20 00 00 00 but where is the different? Does anyone know what I am talking about :-) Is there any memory specification or library for floating point in dBase? Thank you
viliam
Why don't you just read the double from the file to memory and print it with printf or some other function? Then you should see if it is IEEE 754 (and I'm expecting that it is).
Don't try it, just do it! ;-)
-
Why don't you just read the double from the file to memory and print it with printf or some other function? Then you should see if it is IEEE 754 (and I'm expecting that it is).
Don't try it, just do it! ;-)
hi, I try it - doesn't work well. I am afraid that this double value is some modification of IEEE 754 Because file is dBase7 I can not read it in ODBC so I just open this file in DBF Viewer (just see it) the double values are interpreted incorrectly (positive number bigger than zero are ok) But for example White Town dbf tools interpret it well.
viliam