C ++ cosh()函数 (C++ cosh() function)
cosh() function is a library function of cmath header, it is used to find the hyperbolic cosine of the given value (hyperbolic angle), it accepts a number (x) and returns the hyperbolic cosine of x.
COSH()函数是CMATH报头的库函数,它被用于查找给定值(双曲角)的双曲余弦,它接受一个数字(x)和返回x的双曲余弦。
Syntax of cosh() function:
cosh()函数的语法:
cosh(x);
讯享网
Parameter(s): x – is the number (hyperbolic angel) to be used to calculate the hyperbolic cosine.
参数: x –是用于计算双曲余弦的数字(双曲天使)。
Return value: double – it returns double type value that is the hyperbolic cosine of hyperbolic angle x.
返回值: double-返回双精度类型值,即双曲角度x的双曲余弦值。
Example:
例:
讯享网 Input: float x = 2.45; Function call: cosh(x); Output: 5.83732
C ++代码演示cosh()函数的示例 (C++ code to demonstrate the example of cosh() function)
// C++ code to demonstrate the example of // cosh() function #include <iostream> #include <cmath> using namespace std; // main() section int main() {
float x; x = -10.23; cout<<"cosh("<<x<<"): "<<cosh(x)<<endl; x = 0; cout<<"cosh("<<x<<"): "<<cosh(x)<<endl; x = 2.45; cout<<"cosh("<<x<<"): "<<cosh(x)<<endl; return 0; }
Output
输出量
讯享网cosh(-10.23): 13861.2 cosh(0): 1 cosh(2.45): 5.83732
Reference: C++ cosh() function
参考: C ++ cosh()函数
翻译自: https://www.includehelp.com/cpp-tutorial/cosh-function-with-example.aspx

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/38150.html