Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. double

double

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialcomperformancehelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    viliam
    wrote on last edited by
    #1

    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

    A 1 Reply Last reply
    0
    • V 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

      A Offline
      A Offline
      Alexander M
      wrote on last edited by
      #2

      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! ;-)

      V 1 Reply Last reply
      0
      • A Alexander M

        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! ;-)

        V Offline
        V Offline
        viliam
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups