- 论坛徽章:
- 0
|
环境说明, ubuntu 10.04 amd64
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
我照书上写了一个求X的N次方的小程序代码如下.
#include <stdio.h>
float chen(int x,int y)
{
int i,z;
for(i=1,z=x;i<y;i++)
z=z*x;
return z;
}
void main(void)
{
printf("%.0f\n",chen(2,32));
}
求得2的32次方是0; 2的31次方是-2147483648.
我想请教一下前辈们.我要怎样求出比这更大的值了?比如,2的64方,圆周率的后的100位小数.....,请大家赐教,不胜感激.谢谢! |
|