title: Convert pre-IEEE-754 C++ floating-point numbers to/from C#
body: <p>Before .Net, before math coprocessors, before IEEE-574, Microsoft defined a bit pattern for floating-point numbers. Old versions of the C++ compiler happily used that definition.</p>
  
  <p>I am writing a C# app that needs to read/write such floating-point numbers in a file. How can I do the conversions between the 2 bit formats? I need conversion methods in both directions.</p>
  
  <p>This app is going to run in a PocketPC/WinCE environment.</p>
  
  <p>Changing the structure of the file is out-of-scope for this project.</p>
  
  <p>Is there a C++ compiler option that instructs it to use the old FP format? That would be ideal. I could then exchange data between the C# code and C++ code by using a null-terminated text string, and the C++ methods would be simple wrappers around sprintf and atof functions.</p>
  
  <p>At the very least, I'm hoping someone can reply with the bit definitions for the old FP format, so I can put together a low-level bit manipulation algorithm if necessary.</p>
  
  <p>Thanks.</p>