機能 |
余弦(コサイン)を計算することを表す。 |
||
---|---|---|---|
定義 |
#include <math.h> double cos ( double x ); float cos ( float x ); long double cos ( long double x ); ※C99規格では以下の定義となる double cos ( double x ); float cosf ( float x ); long double cosl ( long double x ); |
||
引数 |
|
||
戻り値 | 計算結果を返す。 | ||
実装例 |
#include <math.h> #include <stdio.h> int main(void) { double a = 3.1415926; printf("cos(%f) = %f\n", a, cos(a) ); /* cos(π) */ return 0; } |
||
実行結果 |
cos(3.141593) = -1.000000 |
cos()