title: Some questions about floating points
body: <p>I'm wondering if a number is represented one way in a floating point representation, is it going to be represented in the same way in a representation that has a larger size.
  That is, if a number has a particular representation as a <code>float</code>, will it have the same representation if that <code>float</code> is cast to a <code>double</code> and then still the same when cast to a <code>long double</code>.</p>
  
  <p>I'm wondering because I'm writing a BigInteger implementation and any floating point number that is passed in I am sending to a function that accepts a <code>long double</code> to convert it. Which leads me to my next question. Obviously floating points do not always have exact representations, so in my BigInteger class what should I be attempting to represent when given a float. Is it reasonable to try and represent the same number as given by <code>std::cout &lt;&lt; std::fixed &lt;&lt; someFloat;</code> even if that is not the same as the number passed in. Is that the most accurate representation I will be able to get? If so, ...</p>
  
  <p>What's the best way to extract that value (in base some power of 10), at the moment I'm just grabbing it as a string and passing it to my string constructor. This will work, but I can't help but feel theres a better way, but certainly taking the remainder when dividing by my base is not accurate with floats.</p>
  
  <p>Finally, I wonder if there is a floating point equivalent of <code>uintmax_t</code>, that is a typename that will always be the largest floating point type on a system, or is there no point because <code>long double</code> will always be the largest (even if it 's the same as a double).</p>
  
  <p>Thanks, T.</p>