Definition | #include <math.h> double pow(double x, double y); These functions compute xy. | |
Return val. | x y | if x, y and the result are in the permissible range of floating-point numbers. |
| depending on the function type and the sign of x, in the event of an overflow. | |
1.0 | if x and y are equal to 0. | |
| depending on the function type, if x is equal to 0 and y is less than 0. | |
undefined | if x is less than 0 and y is not an integer. | |
Example | The following program calculates xy for the input arguments x and y. #include <math.h>
#include <stdio.h>
int main(void)
{
double x, y;
scanf("%lf %lf", &x, &y);
printf("%g**%g : %g\n", x, y, pow(x,y));
return 0;
}
| |
See also | exp, hypot, log, log10, sinh, sqrt | |