一个c语言简单问题,求解答

c语言中tan90不存在该怎么表示!!!!!!!!!!!!?????

C语言tan()函数:正切函数

函数名: tan
头文件:<math.h>
函数原型: double tan(double x);
功 能: 正切函数
参 数: double x 为要操作的弧度
返回值:返回x弧度的正切值
公 式:1°=π/180°弧度

程序例: 求30度的正切值


#include<math.h>
 
#include<stdio.h>
 
#define PI 3.14159265
 
int main(void){
 
   double result,x;
 
   x = 30*PI/180; //将30度角转换为弧度
 
   result = tan(x);
 
   printf("The tan of %lf is %lf\n", x, result);
 
   return 0;
 
}
 

运行结果:

The tan of 0.523599 is 0.577350

用sin90/cos90就行了