pow函数的用法书本上是这样的,double pow(double x,double y); 求教函

发布时间:2021-02-25 10:00:26

pow函数的用法书本上是这样的,double pow(double x,double y); 求教函数参数非得是DOUBLE型?函数值类型泥?pow(intx,inty);这样可行?返回值也是INT的?就是说pow()里面不管传什么型的参数,返回的都是DOUBLE型?

网友回答

原型:extern float pow(float x,float y);
用法:#include <math.h>
功能:计算x的y次幂.
说明:x应大于零,返回幂指数的结果.
举例:// pow.c
#include <stdlib.h>
#include <math.h>
#include <conio.h>
void main()
{printf(4^5=%f,pow(4.,5.));
getchar();
}相关函数:pow10
以上问题属网友观点,不代表本站立场,仅供参考!