title: Float and double precision in C
body: <p>In C, double has more precision than float, and according to "C primerplus sixth edition" book (page 80), a float can represent at least 6 significant figures and a double can represent at least 13 significant figures. So I tried to verify that with this simple example:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main(void){
      float a = 3.3333333; // 7 significant digits
      double b = 3.33333333333333;// 14 significant digits
  
      printf("\nFloat:  %f\n", a);
      printf("Double: %f\n", b);
  
      return 0;
  } 
  </code></pre>
  
  <p>And this is the output of this program:</p>
  
  <pre><code>Float : 3.333333
  Double: 3.333333
  </code></pre>
  
  <p>Why does the double value have the same precision as the float value, instead of displaying more significant digits?</p>