作用:
Calculates x raised to the power of y.
函数原型:
double pow( double x, double y );
Required Header:
<math.h>
Compatibility:
ANSI
Return Value
pow returns the value of x y x^{y} xy. No error message is printed on overflow or underflow.
Parameters
x: Base
y: Exponent
特殊 x 和 y 的返回值:
程序示例:
#include<stdio.h>
#include<math.h>
int main(void)
{
double x = 2.0, y = 3.0;
printf("%.1f to the power of %.1f is %.1f.\n", x, y, pow(x, y));
return 0;
}
结果:
2.0 to the power of 3.0 is 8.0.