wayne 发表于 2014-10-5 10:43:41

谁有兴趣 提取出 更高辨识度的 版本来

dianyancao 发表于 2014-10-6 00:20:59


我用如下代码在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;
}

fsleo 发表于 2022-7-31 14:28:02

#include <stdio.h>
#include <math.h>

int main()
{
    printf("%.0f\n", pow(2, 1022));
    return 0;
}

gcc pow.c -o pow && ./pow
44942328371557897693232629769725618340449424473557664318357520289433168951375240783177119330601884005280028469967848339414697442203604155623211857659868531094441973356216371319075554900311523529863270738021251442209537670585615720368478277635206809290837627671146574559986811484619929076208839082406056034304

liyqa 发表于 2022-10-9 07:52:26

腻害呀,学习了
页: 1 [2]
查看完整版本: 标准C语言其实自带高精度运算