pow - C math.h

C examples for math.h:pow

Type

function

From

<cmath>
<ctgmath>
<math.h>

Prototype

long double powl (long double base, long double exponent);
long double pow (long double base, int exponent);
long double pow (long double base, long double exponent);
     double pow (double base, double exponent);
      float powf (float base, float exponent);
     double pow (double base, int exponent);
     double pow (Type1 base , Type2 exponent);        

Description

Returns base raised to the power exponent: base ^ exponent

Parameters

Parameter Description
base Base value.
exponent Exponent value.

Return Value

The result of raising base to the power exponent.

Demo Code


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

int main ()/* w ww  . ja v a2s  .  c o m*/
{
  printf ("%f\n", pow (7.0, 3.0) );
  printf ("%f\n", pow (4.3, 12.0) );
  printf ("%f\n", pow (3.01,1.4) );
  return 0;
}

Related Tutorials