C++幂函数

C++ pow函数使用

//使用到库文件#include<cmath>
int a;
a=(int)pow(2.2,3);
cout<<a;

pow函数原型double pow(double base,double exp)
pow函数的功能是返回以参数base为底的exp次幂。如果base为0,exp不能为负数。如果base不为0,则exp的值无限制。

猜你喜欢

转载自blog.csdn.net/weixin_45534301/article/details/112304462