C++ pow() 函数使用方法及示例 |
您所在的位置:网站首页 › 在c语言中次方用什么表示 › C++ pow() 函数使用方法及示例 |
C++ 按位运算符C++
C++ pow() 函数使用方法及示例
C++ 库函数 pow()函数计算幂。 此函数在头文件中定义。 [数学] baseexponent = pow(base, exponent) [C++ 语言]pow()原型[从C ++ 11标准开始]double pow(double base, double exponent); float pow(float base, float exponent); long double pow(long double base, long double exponent); Promoted pow(Type1 base, Type2 exponent); // 对于其他参数类型从C ++ 11开始,如果传递给pow()的参数为long double,则返回类型Promoted 为long double。如果不是,则返回类型Promoted为double。 pow()参数pow()函数采用两个参数: base -基数 exponent -基数的指数 pow()返回值pow()函数返回以幂为底的底数。 示例1:pow()如何在C ++中工作?#include #include using namespace std; int main () { double base, exponent, result; base = 3.4; exponent = 4.4; result = pow(base, exponent); cout |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |