title: Why does a C floating-point type modify the actual input of 125.1 to 125.099998 on output?
body: <p>I wrote the following program:</p>
  
  <pre><code> #include&lt;stdio.h&gt;
      int main(void)
      {
       float f;
       printf("\nInput a floating-point no.: ");
       scanf("%f",&amp;f);
       printf("\nOutput: %f\n",f);
       return 0;
      }
  </code></pre>
  
  <p>I am on Ubuntu and used GCC to compile the above program. Here is my sample run and output I want to inquire about:</p>
  
  <pre><code>Input a floating-point no.: 125.1
  Output: 125.099998
  </code></pre>
  
  <p>Why does the precision change?</p>