title: Double precision in C - printing 50 significant figures yields inaccurate values
body: <p>I'm doing an integration program with Riemann sums for my Calculus class. I've decided to use C when computing my integrals, and I noticed a huge error in my program that derives from this problem.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;math.h&gt;
  
  int main(int argc, char** argv) {
  
  double x = 2.0/20.0;
  printf("%1.50f \n", x);
  
  
  return (EXIT_SUCCESS);
  }    
  </code></pre>
  
  <p>The program gives me : 0.10000000000000000555111512312578270211815834045410. My question: Why does this happen? And how can I fix this? Or at least round off to ~15 decimal places?</p>
  
  <p>Thanks for the help.</p>