C++ 中複數的 Sinh( ) 函式
我們的任務是找到複數的 sin() 函式的工作原理。複數的 sin( ) 函式存在於複數標頭檔案中,這意味著要計算 sin() 的值,我們需要在程式碼中新增複數值標頭檔案。此函式用於計算複數的雙曲正弦。
語法
template<class t> complex<t> Sinh(const complex<t>& x);
引數
引數 z 可以是任何複數,並且此引數在 sin() 函式的定義中定義,這使得此引數成為必需的。
返回型別
此函式返回 sin( ) 的複數值,因為它包含複數。
輸入 − Sinh(0,1)
輸出 − (0,0.84147)
輸入 − Sinh(1,9)
輸出 − (-1.0707,0.6359)
示例
#include<iostream.h> #include<complex.h> Using namespace std; int main( ){ Complex<double> x(2,7); Cout<< “ The sinh of “ << x << “ = “ << sinh(x) << endl; return 0; }
輸出
如果我們執行上述程式碼,它將生成以下輸出
The sin of (2,7) = (2.734,2.4717)
示例
#include<iostream.h> #include<complex.h> Using namespace std; int main( ){ Complex<double> x(5, 3); Cout<< “ The sinh of “ << x << “ = “ << sinh(x) << endl; return 0; }
輸出
如果我們執行上述程式碼,它將生成以下輸出
The sin of (5, 3) = (-73.4606,10.4725)
廣告