pow
double  pow ( double x, double y );
math.h
  cplusplus.com  

Calculate numeric power.
  Returns x raised to the power of y:   xy

Parameters.

x
Base value.
y
Exponent value.

Return Value.
  x raised to the power of y.

Portability.
  Defined in ANSI-C.
  ANSI-C++ adds float and double overloaded versions of this function, with the same bahavior but being all of them, parameters and return value, of one of these types.

Example.

/* pow example */
#include <stdio.h>
#include <math.h>

int main ()
{
  printf ("7 ^ 3 = %lf\n", pow (7,3));
  printf ("4.73 ^ 12 = %lf\n", pow (4.73,12));
  printf ("32.01 ^ 1.54 = %lf\n", pow (32.01,1.54));
  return 0;
}
Output:
7 ^ 3 = 343.000000
4.73 ^ 12 = 125410439.217423
32.01 ^ 1.54 = 208.036691

See also.
  exp, log, sqrt


© The C++ Resources Network, 2000