我用如下代码在VS中输出 (long double不够存放2^1022)
44942328371557898000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000
#include <stdio.h>
#include <math.h>
using namespace std;
int main()
{
printf("%.0f\n",pow((long double)2.0,1022));
return 0;
} #include <stdio.h>
#include <math.h>
int main()
{
printf("%.0f\n", pow(2, 1022));
return 0;
}
gcc pow.c -o pow && ./pow
44942328371557897693232629769725618340449424473557664318357520289433168951375240783177119330601884005280028469967848339414697442203604155623211857659868531094441973356216371319075554900311523529863270738021251442209537670585615720368478277635206809290837627671146574559986811484619929076208839082406056034304 腻害呀,学习了
页:
1
[2]