title: About the pow function in C++
body: <p>I just tried three pieces of code：</p>
  
  <pre><code>#include&lt;cstdio&gt;
  #include&lt;cmath&gt;
  #include&lt;cstring&gt;
  int main()
  {
      int a = 3;
      int b = pow(10,a);
      printf("%d",b);
      return 0;
  }
  //Output:1000
  
  #include&lt;cstdio&gt;
  #include&lt;cmath&gt;
  #include&lt;cstring&gt;
  int main()
  {
      int a = 3;
      int b = pow(10,a-1);
      printf("%d",b);
      return 0;
  }
  //Output:99
  
  #include&lt;cstdio&gt;
  #include&lt;cmath&gt;
  #include&lt;cstring&gt;
  int main()
  {
      int a = 3;
      int b = pow(10,a-2);
      printf("%d",b);
      return 0;
  }
  //Output:10
  </code></pre>
  
  <p>I would like to know why the second block of code will output 99, is it because of floating point precision? Or is it because I should use float numbers in the pow function?(Such as 10.0)
  I'm usually confused about the accuracy of C++, I will be grateful for your help.</p>