cbrt函数_cbrt()函数以及C ++中的示例
cbrt函数
C ++ cbrt()函数 (C++ cbrt() function)
cbrt() function is a library function of cmath header, it is used to find the cubic root of a given number, it accepts a number and returns the cubic root.
cbrt()函数是cmath标头的库函数,用于查找给定数字的立方根 ,它接受数字并返回立方根。
Syntax of cbrt() function:
cbrt()函数的语法:
cbrt(x);
Parameter(s): x – a number whose cubic root to be calculated.
参数: x-要计算其立方根的数字。
Return value: double – it returns double value that is the cubic root of the given number x.
返回值: double-它返回double值,它是给定数字x的立方根。
Example:
例:
Input:
int x = 2;
Function call:
cbrt(x);
Output:
1.25992
C ++代码演示cbrt()函数的示例 (C++ code to demonstrate the example of cbrt() function)
// C++ code to demonstrate the example of
// cbrt() function
#include <iostream>
#include <cmath>
using namespace std;
// main code section
int main()
{float x;
//input the value
cout<<"Enter a number: ";
cin>>x;
// calculate the square root
float result = cbrt(x);
cout<<"cubic root of "<<x<<" is = "<<result;
cout<<endl;
return 0;
}
Output
输出量
First run:
Enter a number: 10
cubic root of 10 is = 2.15443
Second run:
Enter a number: 123.45
cubic root of 123.45 is = 4.97925
Third run:
Enter a number: 0
cubic root of 0 is = 0
Fourth run:
Enter a number: -1234
cubic root of -1234 is = -10.726
翻译自: https://www.includehelp.com/cpp-tutorial/cbrt-function-with-example.aspx
cbrt函数
cbrt函数_cbrt()函数以及C ++中的示例相关推荐
- java函数参数使用冒号_java8中:: 用法示例(JDK8双冒号用法)
JDK8中有双冒号的用法,就是把方法当做参数传到stream内部,使stream的每个元素都传入到该方法里面执行一下. 代码其实很简单: 以前的代码一般是如此的: public class Accep ...
- stl vector 函数_vector :: clear()函数,以及C ++ STL中的示例
stl vector 函数 C ++ vector :: clear()函数 (C++ vector::clear() function) vector::clear() is a library f ...
- stl vector 函数_vector :: push_back()函数,以及C ++ STL中的示例
stl vector 函数 C ++ vector :: push_back()函数 (C++ vector::push_back() function) vector::push_back() is ...
- c语言中vector函数大全,vector :: empty()函数,以及C ++ STL中的示例
C ++ vector :: empty()函数 矢量::空()是一个库函数"载体"头,它是用来检查给定的矢量是否是一个空的载体或没有,它返回一个真,如果矢量大小为0,否则返回假. ...
- stl vector 函数_vector :: crbegin()函数,以及C ++ STL中的示例
stl vector 函数 C ++ vector :: crbegin()函数 (C++ vector::crbegin() function) vector::crbegin() is a lib ...
- main函数参数,在VS中向命令行添加参数的方法
问题描述 使用main函数的参数,实现一个整数计算器,程序可以接受三个参数,第一个参数"-a"选项执行加法,"-s"选项执行减法,"-m"选 ...
- 函数指针--Nginx和Redis中两种回调函数写法
1.Nginx和Redis中两种回调函数写法 #include <stdio.h>//仿Nginx风格 //结构外声明函数指针类型 typedef void (*ngx_connectio ...
- ACMNO.40 C语言-子串 有一字符串,包含n个字符。写一函数,将此字符串中从第m个字符开始的全部字符复制成为另一个字符串
题目描述 有一字符串,包含n个字符. 写一函数,将此字符串中从第m个字符开始的全部字符复制成为另一个字符串. 输入 数字n 一行字符串 数字m 输出 从m开始的子串 样例输入 6 abcdef 3 样 ...
- R语言使用basename函数获取数据链接地址中的文件名称(removes all of the path up to and including the last path separator )
R语言使用basename函数获取数据链接地址中的文件名称(removes all of the path up to and including the last path separator (i ...
- pandas使用iteritems函数迭代地查看dataframe中的每个数据列(iterate over each column of a dataframe)
pandas使用iteritems函数迭代地查看dataframe中的每个数据列(iterate over each column of a dataframe) 目录 pandas使用iterite ...
最新文章
- Top100论文导读:深入理解卷积神经网络CNN(Part Ⅱ)
- Windows Server 2016 Technical Preview 5 X64 中文版下载地址
- 开关磁阻电机调速控制的仿真研究
- Python 生成器(yield)
- android高德天气api,天气预报-天气预报-示例中心-JS API 2.0 示例 | 高德地图API
- mysql5.0.x统计每秒增删改查替换数及系统每秒磁盘IO
- 7-2 组织星期信息 (10 分)
- c语言 extern_C语言入门笔记(三)
- Python基础090:解决jupyter notebook无法自动跳转chrome浏览器的问题
- MFC界面UI像素设计
- aspose.words生成pdf字体乱码为方框
- ubuntu 装机必备软件
- 许奔创新社-第27问:创新者们如何进行跨界交流?
- SVN SSL错误解决
- python电影名称词云_python wordcloud 对电影《我不是潘金莲》制作词云
- 电影人生 - 一个人的电影
- python 全栈开发,Day106(结算中心(详细),立即支付)
- 如何让c语言编的游戏运行,如何用C语言编写游戏一.doc
- python感叹号是什么意思_监控画面的这个感叹号是什么意思
- 【数据库】彻底理解外键的作用