/*
写一函数求sinh(x)的值,求sinh(x)的近似公式为:
sinh(x) = (ex-e-x)/2
其中用一个函数求ex
*/
#include<iostream>
using namespace std;
#include<cmath>
#define e 2.71828
double e_fun(int x)
{
return pow(e,x);
}
double sinh_fun(int x)
{
return (e_fun(x)-1.0/ e_fun(x))/2;
}
int main()
{
int x;
cout << "请输入参数x:" << endl;
cin >> x;
cout << sinh_fun(x) << endl;
return 0;
}
函数:写一函数求sinh(x)的值,求sinh(x)的近似公式为: sinh(x) = (ex-e-x)/2 其中用一个函数求ex
最新推荐文章于 2024-07-18 23:31:00 发布