トップページ > キーワード検索 > sin()
C言語規格
C言語(その他)
プログラム
その他
sin()
機能 正弦(サイン)を計算することを表す。
定義 #include <math.h>

double sin ( double x );
float sin ( float x );
long double sin ( long double x );

※C99規格では以下の定義となる
double sin ( double x );
float sinf ( float x );
long double sinl ( long double x );
引数
x角度(ラジアン値)
戻り値 計算結果を返す。
実装例
#include <math.h>
#include <stdio.h>

int main(void)
{
    double a = 3.1415926;
    
    printf("sin(%f) = %f\n", a, sin(a) );  /* sin(π) */

    return 0;
}
実行結果
sin(3.141593) = 0.000000





inserted by FC2 system