sinh()函數是在複雜頭文件中定義的C++中的內置函數。此函數是cmath頭文件中提供的sinh()函數的複雜版本。此函數用於計算複數z的複雙曲正弦值。
用法:
template<class T> complex<T> sinh (const complex<T>& z );
參數:
- z:該方法采用代表複數的mandaory參數z。
返回值:此函數返回複數z的雙曲正弦值。
以下示例程序旨在說明C++中複雜頭文件的sinh()函數:
範例1:
// C++ program to demonstrate
// example of sinh() function.
#include <bits/stdc++.h>
using namespace std;
int main ()
{
complex<double> complexnumber (0.0, 1.0);
// use of sinh() function for complex number
cout << "The sinh of " << complexnumber << " is "
<< sinh(complexnumber) <<endl;
return 0;
}
輸出:
The sinh of (0,1) is (0,0.841471)
範例2:
// CPP program to demonstrate
// example of sinh() function.
#include <bits/stdc++.h>
using namespace std;
int main()
{
complex<double> complexnumber (1.0, 0.0);
// use of sinh() function for complex number
cout << "The sinh of " << complexnumber << " is "
<< sinh(complexnumber) << endl;
return 0;
}
輸出:
The sinh of (1,0) is (1.1752,0)
相關用法
- C++ complex log()用法及代碼示例
- C++ complex exp()用法及代碼示例
- C++ complex tan()用法及代碼示例
- C++ complex pow()用法及代碼示例
- C++ complex arg()用法及代碼示例
- C++ complex cos()用法及代碼示例
- C++ complex asin()用法及代碼示例
- C++ complex log10()用法及代碼示例
- C++ complex asinh()用法及代碼示例
- C++ complex cosh()用法及代碼示例
- C++ complex atan()用法及代碼示例
- C++ complex acosh()用法及代碼示例
- C++ complex atanh()用法及代碼示例
- C++ complex polar()用法及代碼示例
- C++ complex acos()用法及代碼示例
注:本文由純淨天空篩選整理自bansal_rtk_大神的英文原創作品 sinh() function for Complex Number in C++。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。