c+pow函数的头文件

C ++ pow()函数 (C++ pow() function)

pow() function is a library function of cmath header (<math.h> in earlier versions), it is used to find the raise to the power, it accepts two arguments and returns the first argument to the power of the second argument.

pow()函数cmath标头的库函数(在早期版本中为<math.h>),用于查找幂的加数,它接受两个参数并将第一个参数返回为第二个参数的幂。

Syntax of pow() function:

pow()函数的语法:

    pow(x, y);

Parameter(s): x, y – are the numbers to calculate x^y.

参数: x,y –是用于计算x ^ y的数字。

Return value: double – it returns double value that is calculate result of x to the power of y.

返回值: double-返回double值,它是x的计算结果乘以 y的幂。

Example:

例:

    Input:
float x = 2;
float y = 3;
Function call:
pow(x,y);
Output:
8

C ++代码演示pow()函数的示例 (C++ code to demonstrate the example of pow() function)

// C++ code to demonstrate the example of
// pow() function
#include <iostream>
#include <cmath>
using namespace std;
// main code section
int main()
{float x;
float y;
//input the values
cout<<"Enter the value of x: ";
cin>>x;
cout<<"Enter the value of y: ";
cin>>y;
// calculate the power
float result = pow(x,y);
cout<<x<<" to the power of "<<y<<" is = "<<result;
cout<<endl;
return 0;
}

Output

输出量

First run:
Enter the value of x: 10
Enter the value of y: 5
10 to the power of 5 is = 100000
Second run:
Enter the value of x: 10.23
Enter the value of y: 1.5
10.23 to the power of 1.5 is = 32.72
Third run:
Enter the value of x: 10
Enter the value of y: 0
10 to the power of 0 is = 1
Fourth run:
Enter the value of x: 0
Enter the value of y: 1.5
0 to the power of 1.5 is = 0

翻译自: https://www.includehelp.com/cpp-tutorial/pow-function-with-example.aspx

c+pow函数的头文件

c+pow函数的头文件_pow()函数以及C ++中的示例相关推荐

  1. c++常用函数所在头文件一览

    c++常用函数所在头文件一览 函数           包含              类别              功能 _atold             math.h            ...

  2. C语言再学习 -- 常用头文件和函数(转)

    参看:C/C++常用头文件及函数汇总 linux常用头文件如下: POSIX标准定义的头文件 <dirent.h>        目录项 <fcntl.h>         文 ...

  3. c语言的函数头书写标准,C语言的头文件的函数和书写方法.doc

    C语言的头文件的函数和书写方法 C语言头文件作用及写法 头文件几个好处: 1,头文件可以定义所用的函数列表,方便查阅你可以调用的函数:2,头文件可以定义很多宏定义,就是一些全局静态变量的定义,在这样的 ...

  4. VSCODE编译头文件时函数没有定义的解决方案(VSCODE手动链接C文件方法)

    VSCODE编译头文件时函数没有定义的解决方案(VSCODE手动链接C文件方法) 参考文章: (1)VSCODE编译头文件时函数没有定义的解决方案(VSCODE手动链接C文件方法) (2)https: ...

  5. 【Android 内存优化】libjpeg-turbo 函数库交叉编译与使用 ( 交叉编译脚本编写 | 函数库头文件拷贝 | 构建脚本配置 | Android Studio 测试函数库 )

    文章目录 一.交叉编译 Shell 脚本参考 二.NDK r16b 版本配置 三.libjpeg-turbo 交叉编译 Shell 脚本 四.执行 libjpeg-turbo 交叉编译 Shell 脚 ...

  6. 【Android FFMPEG 开发】Android Studio 工程配置 FFMPEG ( 动态库打包 | 头文件与函数库拷贝 | CMake 脚本配置 )

    文章目录 I . FFMPEG 交叉编译后的函数库及头文件 II . FFMPEG 静态库打包动态库 ( 仅做参考 ) III . 创建 Android Studio 工程 IV . FFMPEG 头 ...

  7. c语言 recv_sin,C++_C语言中经socket接收数据的相关函数详解,recv()函数: 头文件:#incl - phpStudy...

    C语言中经socket接收数据的相关函数详解 recv()函数:头文件: #include #include 定义函数: int recv(int s, void *buf, int len, uns ...

  8. linux延时函数及头文件,linux延时函数

    应用程序的延时函数: 头文件: #include 函数:unsigned int sleep (unsigned int seconds);//n秒 此外:int usleep (useconds_t ...

  9. 标准C函数库头文件、POSIX标准库头文件和Windows API函数库头文件说明

    1. 标准C函数库头文件 名字 源自 描述 <assert.h> 包含断言宏,被用来在程序的调试版本中帮助检测逻辑错误以及其他类型的bug. <complex.h> C99 一 ...

最新文章

  1. win10安装MAYA失败,怎么强力卸载删除注册表并重新安装
  2. cdqz2017-test10-加帕里图书馆(区间DP 简单容斥)
  3. ai边缘平滑_华为P40的多帧曝光AI智能处理,逆光也能无法阻挡你的美
  4. CodeForces798cMike and gcd problem
  5. cf1208G Polygons 欧拉函数
  6. java单例模式双重检查
  7. WireShark帧格式解析
  8. 用firework中合并图标的方法
  9. 安装alexa工具条报毒
  10. 康佳如何做“加法”?
  11. 开心消消乐html5游戏在线玩,开心消消乐在线玩
  12. EffectCreator for mac(抖音短视频编辑软件)
  13. 手机序列号和IMEI号的区别
  14. UVM重点归纳(一)
  15. html description字数限制,description标签如何正确使用?
  16. 宾得常用镜头群[转自东河寒梅]
  17. Laravel 联合查询 count计数去重
  18. 计算机专业扬大vs兰州大学,复试奇怪景象:兰州大学初试前五(400+)都被刷!扬州大学唯一上线也被刷!...
  19. Linux系统安装中文字体
  20. 金仓数据库KingbaseES 插件kdb_database_link

热门文章

  1. opencv获取模板旋转角度_OpenCV入门之获取图像的旋转角度
  2. Pytorch RuntimeERROR: Given groups=1 weights of size [256,64,1,1] expected input[1,16,256,256] to
  3. ELK学习笔记之Logstash详解
  4. C#使用ListView更新数据出现闪烁解决办法
  5. Script:List OBJECT DEPENDENT
  6. Palo Alto Networks漏洞防护扩展至云端
  7. 基于Fragment的百度地图框架的使用
  8. 多路复用与设置阻塞、非阻塞模式
  9. Visual C++ 时尚编程百例016(字体)
  10. 攻略:三大秘籍让你笑傲IT职场!