title: best way to output a full precision double into a text file
body: <p>I need to use an existing text file to store some very precise values.  When read back in, the numbers essentially need to be exactly equivalent to the ones that were originally written.  Now, a normal person would use a binary file... for a number of reasons, that's not possible in this case.</p>
  
  <p>So... do any of you have a good way of encoding a double as a string of characters (aside from increasing the precision).  My first thought was to cast the double to a char[] and write out the chars.  I don't think that's going to work because some of the characters are not visible, produce sounds, and even terminate strings ('\0'... I'm talkin to you!)</p>
  
  <p>Thoughts?</p>
  
  <p>[Edit] - once I figure out which of the solutions proposed works best for me, I'll mark one as 'the' solution.</p>