|
-
Oct 1st, 2002, 08:45 PM
#1
Thread Starter
Junior Member
Why do i get this error???
For some reason i keep getting this error in the following code
error C2660: 'pow' : function does not take 1 parameters This error appears twice for the two lines that i am using pow can anyone please help me
#include <iostream.h>
#include <math.h>
void main()
{
double a,b,c;
double r1;
double r2;
cout<<"Please enter the a: ";
cin>>a;
cout<<"Please enter the b: ";
cin>>b;
cout<<"Please enter the c: ";
cin>>c;
r1 = (-1*b+pow((b*b-4*a*c)*0.5))/(2.0*a);
r2 = (-1*b-pow((b*b-4*a*c)*0.5))/(2.0*a);
if (r1>=0 && r2>=0)
{
cout<<"the roots are reals "<<endl;
}
else
{
cout<<"the roots are not real"<<endl;
}
if (r1 > r2)
{
cout<<"the largest root is "<<r1<<endl;
}
else
{
cout<<"the largest root is "<<r2<<endl;
}
}
-
Oct 1st, 2002, 09:33 PM
#2
Frenzied Member
Code:
double r;
r = pow(13, 3);
// thirteen to the third power
pow(double arg1, double arg2)
-
Oct 2nd, 2002, 08:58 AM
#3
Seems like you've lost track of your own code (is it?).
Bad thing if that happens...
But for once MSVC++ gives an error message that is actually comprehensible
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|