底层的c语言要求a^p 或者x开n次方,原来都提供了api,就是不起眼的pow
底层的c语言要求a^p 或者x开n次方,原来都提供了api,就是不起眼的pow
double(double,double)
double(int,int)
double(int,double)
double(double,int)
pow(a,p)=a^p
pow(a,1.0/x)=a^(1.0/x) 就是a开x次方
突然觉得pow好强大了 math.h里
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<pow(2,10)<<endl;//1024
cout<<pow(1024,1.0/10);//1024^(1.0/2)=2 pow实现了开方 妙妙妙
return 0;
}