In article <1c5bh.20014$yV.6551@trnddc07>,

Larry Smith <ls****@nospam.comwrote:

Chris Stankevitz wrote:
Q1: Does c++ provide pow(int,int)?

Q2: If not, why not?

Thanks,

Chris

The ISO/ANSI Std 'C' function is:

double pow(double x, double y);

This is supported by C++; just include

<math.hor <cmath>.

C++98 adds:

float pow(float, float);

float pow (float, int);

double pow(double, int);

long double pow(long double, long double);

long double pow(long double, int);

The current C++0X working draft adds:

Moreover, there shall be additional overloads sufficient to ensure:

1. If any argument corresponding to a double parameter has type long

double, then all arguments corresponding

to double parameters are effectively cast to long double.

2. Otherwise, if any argument corresponding to a double parameter has

type double or an integer type, then all

arguments corresponding to double parameters are effectively cast to

double.

3. Otherwise, all arguments corresponding to double parameters are

effectively cast to float.

-Howard