如何将e的值精确到小数点后面3000位啊?

来源:百度知道 编辑:UC知道 时间:2024/06/21 23:17:56
麻烦各位高手想想办法啊,毕业设计继续要啊普通的算法最多算到几十位就不错了

/*给个求大数阶乘的自编程序你,
下面的自己看着办吧
10000!两三秒吧,如果不输出更快
而且计算出10000!之前需要计算出之前的2-9999的阶乘
所以针对你的问题只要一次就可以了*/

/*
2 (C) Xuotoa 2008 http://www.xuotoa.cn/
3
4 Filename : BigNumberFact.c
5 Compiler : Visual C++ 6.0 / Visual Studio 2008
6 Description : Calculate the factory of big number
7 Release : 12/20/2008 1.0
8 */

#include <stdio.h>
#include <stdlib.h>

int a[8000], n, i, j, carry, temp, digit = 1;

int Fact(int n);

void main()
{
/*FILE *fp;
if((fp = fopen("fac_result.log","w")) == NULL)
{
printf("Cannot open this file.\n");
exit(0);
}*/
printf("Please input n: ");
scanf("%d",&n);
printf("%d! is: \n",n);
Fact(n);
for(i = digit - 1; i >= 0; i