C examples for math.h:pow
function
<cmath> <ctgmath> <math.h>
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);
Returns base raised to the power exponent: base ^ exponent
Parameter | Description |
---|---|
base | Base value. |
exponent | Exponent value. |
The result of raising base to the power exponent.
#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; }