title: Is floating point precision mutable or invariant?
body: <p>I keep getting mixed answers of whether floating point numbers (i.e. <code>float</code>, <code>double</code>, or <code>long double</code>) have one and only one value of precision, or have a precision value which can vary.</p>
  
  <p>One topic called <a href="https://stackoverflow.com/questions/5098558/float-vs-double-precision">float vs. double precision</a> seems to imply that floating point precision is an absolute.</p>
  
  <p>However, another topic called <a href="https://stackoverflow.com/questions/2386772/difference-between-float-and-double">Difference between float and double</a> says,</p>
  
  <blockquote>
    <p><em>In general a double has <strong>15 to 16</strong> decimal digits of precision</em></p>
  </blockquote>
  
  <p>Another <a href="http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/" rel="nofollow noreferrer">source</a> says,</p>
  
  <blockquote>
    <p><em>Variables of type float typically have a precision of <strong>about</strong> 7 significant digits</em></p>
    
    <p><em>Variables of type double typically have a precision of <strong>about</strong> 16 significant digits</em></p>
  </blockquote>
  
  <p>I don't like to refer to approximations like the above if I'm working with sensitive code that can break easily when my values are not exact. So let's set the record straight. Is floating point precision mutable or invariant, and why?</p>