关于圆的周长

来源:百度知道 编辑:UC知道 时间:2024/05/29 19:30:08
圆的周长总是直径的3倍多一些,那么到底是多多少?(有精确的哦!)

圆周率嘛,
是个无理数,无限不循环小数。
虽然不能简单表示,

但可以用无穷级数以及一些其他表示。

π=16arctan1/5-4arctan1/239

编程计算如下
【C++编译器中的运算程序】
微机WindowsXP中Dev-cpp中的运算程序(30000位)(C++)
#include <cstdlib.h>
#include <iostream.h>
#include <fstream.h>
#define N 30015
using namespace std;
void mult (int *a,int b,int *s)
{
for (int i=N,c=0;i>=0;i--)
{
int y=(*(a+i))*b+c;
c=y/10;
*(s+i)=y%10;
}
}
void divi (int *a,int b,int *s)
{
for (int i=0,c=0;i<=N;i++)
{
int y=(*(a+i))+c*10;
c=y%b;
*(s+i)=y/b;
}
}
void incr(int *a,int *b,int *s)
{
for (int i=N,c=0;i>=0;i--)
{
int y=(*(a+i))+(*(b+i))+c;
c=y/10;
*(s+i)=y%10;
}
}
bool eqs(int *a,int *b)
{
int i=0;
while (((*(a+i))==(*(b+i)))&&(i<=N)) i++;
return