首页 > 编程知识 正文

幂函数以及指数函数,函数题目以及答案

时间:2023-05-03 20:08:45 阅读:258593 作者:3437

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() sectionint 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.2cosh(0): 1cosh(2.45): 5.83732

Reference: C++ cosh() function

参考: C ++ cosh()函数

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

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。