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