title: Floating-Point Arithmetic = What is the worst precision/difference from Dec to Binary?
body: <p>as all know <code>decimal fractions</code> (like 0.1) , when stored as <code>floating point</code> (like double or float) will be internally represented in "binary format" (IEEE 754). And some decimal fractions can not directly be represented in binary format. </p>
  
  <p>What I have not understood, is the precision of this "conversion":</p>
  
  <p>1.) A Floating point itself can have a precision (that is the "significant")?</p>
  
  <p>2.) But also the conversion from decimal fraction to binary fraction has a precision loss?</p>
  
  <p><strong>Question:</strong></p>
  
  <p>What is the worst case precision loss (for "all" possible decimal fractions) when converting from decimal fractions to floating point fractions? </p>
  
  <p>(The reason I want to know this is, when comparing decimal fractions with binary/floating point fractions I need to take the precision into account...to determine if both figures are identical. And I want this precision to be as tight/precise as possible <code>(decimal fraction ==  binary fraction +/- precision)</code> </p>
  
  <p><strong>Example (only hypothetical)</strong></p>
  
  <pre><code>0,1 dec =&gt; 0,10000001212121212121212 (binary fraction double) =&gt; precision loss 0,00000001212121212121212
  0,3 dec =&gt; 0,300000282828282 (binary fraction double) =&gt; precision loss  0,000000282828282
  </code></pre>