跳轉到內容

C++ 程式設計/程式碼/標準 C 庫/函式/cos

來自華夏公益教科書,開放的書籍,開放的世界
語法
#include <cmath>
float cos( float arg );
double cos( double arg );
long double cos( long double arg );

cos() 函式返回 arg 的餘弦值,其中 arg 以弧度表示。cos() 的返回值範圍為 [-1,1]。如果 arg 為無窮大,則 cos() 將返回 NAN 並引發浮點異常。

相關主題
acos - asin - atan - atan2 - cosh - sin - sinh - tan - tanh
華夏公益教科書