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…
errorC2668: ‘pow’ : ambiguous call to overloaded function
the line of code I have for it is as follows
perfect = (pow(2,(num-1))) * (pow(2,num)-1);
Any recommendations?
Thanks in advance
EDIT:
num is indeed declared as an int.
num does have a value, starts at 1 and goes to UINT_MAX
Added an asterisk to equation
The compiler doesn’t know which pow() function to call. The overloads listed here gives the following list:
The compiler won’t guess which one to use. Make it explicit with a casts.
There may be some extra casts there, but they won’t hurt anything.