title: Differences in rounded result when calling pow()
body: <p>OK, I know that there was many question about pow function and casting it's result to int, but I couldn't find answer to this a bit specific question.</p>
  
  <p>OK, this is the C code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;math.h&gt;
  
  int main()
  {
      int i = 5;
      int j = 2;
  
      double d1 = pow(i,j);
      double d2 = pow(5,2);
      int i1 = (int)d1;
      int i2 = (int)d2;
      int i3 = (int)pow(i,j);
      int i4 = (int)pow(5,2);
  
      printf("%d %d %d %d",i1,i2,i3,i4);
  
      return 0;
  }
  </code></pre>
  
  <p>And this is the output: "25 25 24 25". Notice that only in third case where arguments to pow are not literals we have that wrong result, probably caused by rounding errors. Same thing happends without explicit casting. Could somebody explain what happens in this four cases?</p>
  
  <p>Im using CodeBlocks in Windows 7, and MinGW gcc compiler that came with it.</p>