C语言中M_PI头文件

来源:百度知道 编辑:UC知道 时间:2024/05/26 09:17:48
求M_PI的头文件
VC++6.0环境里的,以为是在math.h中,但没有
自己编的只有用宏定义#define M_PI来表示3.14
#include<stdio.h>
#include<math.h>
#include<ctype.h>
#include<conio.h>
double ssin(float a);
double ccos(float a);
double ttan(float a);
#define M_PI 3.14
int main()
{
float a;
double b,d,e;
char c;
printf("\n此程序用于计算三角函数");
do
{
printf("\n请输入角度:");
fflush(stdin);
scanf("%f",&a);
b=ssin(a);
d=ccos(a);
e=ttan(a);
printf("\nsin%1.2f=%1.2f",a,b);
printf("\ncos%1.2f=%1.2f",a,d);
printf("\ntan%1.2f=%1.2f",a,e);
printf("\n是否继续?(y/n):");
fflush(stdin);
scanf("%c",&c);
}while(toupper(c)=='Y');
printf("\n程序结束,按任意键程序关闭!\n");
getch();
return 0;
}
double ssin(float

M_PI的头文件是math.h
#include<math.h> ,这一句声明了本程序要用到标准库中的 math.h文件。math.h头文件中声明了常用的一些数学运算,比如乘方,开方运算等等,还包含一系列常用变量的定义。
#define M_PI 3.1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6
就是指定义M_PI为圆周率。

我查了下 在math.h中没有找到你要的宏定义