Here is the part of the code that generated the errors.
----------------------------------------------------------------------------------------------------------------
Expand|Select|Wrap|Line Numbers
- int divsum(int x, vector<int> y) //returns the sum of the PROPER divisors
- {
- int t;
- double sum=1;
- int L=y.size();
- for(t=0; t<L; t++) //go through each element of the list of generated primes
- {
- int e=1;
- double psum=1;
- if(x%y[t]==0)//test for divisibility
- {
- while(fmod(x,pow(y[t],e))==0) //sum of p^e where p^e divides y
- {
- psum=(int) psum+pow(y[t],e);
- e++;
- }
- sum=sum*psum; //formula for divisor sum
- }
- }
- int rsum; rsum= (int)sum;
- return rsum-x;
- }
The error messages all read something similar to: "divisorsum.cpp:73: error: call of overloaded âpow(int&, int&)â is ambiguous"
What is the mistake, and how can I avoid making it in the future?