#include <math.h>
double sin( double arg );
函数返回参数 arg 的正弦值,arg 以弧度表示给出。
#include <stdio.h> #include <math.h> int main(void) { double result, x = 0.5; result = sin(x); printf("The sin() of %lf is %lf\n", x, result); return 0; }
输出结果:
The sin() of 0.500000 is 0.479426