title: Division of two floats giving incorrect answer
body: <p>Attempting to divide two floats in C, using the code below:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  int main(){
    float fpfd = 122.88e6;
    float flo = 10e10;
    float int_part, frac_part;
  
    int_part = (int)(flo/fpfd);
    frac_part = (flo/fpfd) - int_part;
  
    printf("\nInt_Part = %f\n", int_part);
    printf("Frac_Part = %f\n", frac_part);
  
    return(0);
  }
  </code></pre>
  
  <p>To this code, I use the commands:</p>
  
  <pre><code>&gt;&gt; gcc test_prog.c -o test_prog -lm
  &gt;&gt; ./test_prog
  </code></pre>
  
  <p>I then get this output:</p>
  
  <pre><code>Int_Part = 813.000000
  Frac_Part = 0.802063
  </code></pre>
  
  <p>Now, this Frac_part it seems is incorrect. I have tried the same equation on a calculator first and then in Wolfram Alpha and they both give me:</p>
  
  <pre><code>Frac_Part = 0.802083
  </code></pre>
  
  <p>Notice the number at the fifth decimal place is different.</p>
  
  <p>This may seem insignificant to most, but for the calculations I am doing it is of paramount importance.</p>
  
  <p>Can anyone explain to me why the C code is making this error?</p>