title: Java Math.pow(a,b) time complexity
body: <p>I would like to ask  time complexity of the following code. Is it O(n)? (Is time complexity of Math.pow()  O(1)? ) In general, is Math.pow(a,b) has time complexity O(b) or O(1)? Thanks in advance.</p>
  
  <pre><code>public void foo(int[] ar) {
     int n = ar.length;
     int sum = 0;
     for(int i = 0; i &lt; n; ++i) {
  
       sum += Math.pow(10,ar[i]);
  
     }
  }
  </code></pre>