title: confuse in "double to long long" in c++
body: <p>my code:</p>
  
  <pre><code>int main()
  {
  long long a = pow(2,63) - 1;
  long long b = pow(2,63);
  double c  = pow(2,63) - 1;
  double d = pow(2,63);
  printf("%lld %lld \n%f %f \n%lld %lld\n", a, b, c, d, (long long)c, (long long)d);
  
  return 0;
  }
  </code></pre>
  
  <p>and the excute result is (codeblock with gcc in win7 x64):</p>
  
  <pre><code>9223372036854775807 9223372036854775807
  9223372036854775800.000000 9223372036854775800.000000
  -9223372036854775808 -9223372036854775808
  </code></pre>
  
  <p><strong>Question:</strong></p>
  
  <p>Why <code>a == b</code> ?</p>
  
  <p>I know that <code>c == d</code> because of the precision of <code>double</code>.</p>
  
  <p>But why <code>(long long)c</code> and <code>(long long)d</code> is not <code>9223372036854775800</code> ?</p>
  
  <p>And why <code>(long long)c != a</code>  and <code>(long long)d != b</code>?</p>