title: How do you use an exponent in c++ with a variable?
body: <p>So I realize that #include is necessary, and that there is a pow(x,y) where x^y works...but when I attempted to use pow(2,(num-1)), it kicked back an error...</p>
  
  <p>errorC2668: 'pow' : ambiguous call to overloaded function</p>
  
  <p>the line of code I have for it is as follows</p>
  
  <pre><code>perfect = (pow(2,(num-1))) * (pow(2,num)-1);
  </code></pre>
  
  <p>Any recommendations?</p>
  
  <p>Thanks in advance</p>
  
  <p>EDIT:</p>
  
  <p>num is indeed declared as an int.</p>
  
  <p>num does have a value, starts at 1 and goes to UINT_MAX</p>
  
  <p>Added an asterisk to equation</p>