pow(int , int)

Eduardo Osorio Armenta e_osorio@yahoo.com
Wed Dec 4 10:32:00 GMT 2002


this send me an error!

for (i = 0; i < 32; i++)
  {
    cout << "2^" << dec << i << " = 0x" << hex << 
    pow(2, i) << endl;
  }


exponencial.cpp:19: call of overloaded `pow(int,
int&)' is ambiguous
/usr/include/math.h:60: candidates are: double
pow(double, double)
/usr/include/c++/3.2/cmath:427:                 long
double std::pow(long
   double, int)
/usr/include/c++/3.2/cmath:423:                 float
std::pow(float, int)
/usr/include/c++/3.2/cmath:419:                 double
std::pow(double, int)
/usr/include/c++/3.2/cmath:414:                 long
double std::pow(long
   double, long double)
/usr/include/c++/3.2/cmath:401:                 float
std::pow(float, float)
make: *** [exponencial] Error 1

--------------------------------------------
but this works fine....

for (i = 0; i < 32; i++)
  {
    cout << "2^" << dec << i << " = 0x" << hex << 
     pow(2.0, i) << endl;
  }


so my question is :

pow( ) does not support pow(int, int); ?

just :
  
long double std::pow(long double, int)
 float std::pow(float, int)
double std::pow(double, int)
long double std::pow(long double, long double)
 float std::pow(float, float)


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the Gcc-help mailing list