问题遇到的现象和发生背景
https://blog.csdn.net/xuexiacm/article/details/8122267
按照以上博文所说long double类型能存储的数据长度应该是比double长的,我用vs2019编译时需要计算较大的数据想用long double类型
问题相关代码
#include <iostream>
using namespace std;
void main()
{
cout << "double类型的最大值:" << (numeric_limits<double>::max)();
cout << "\nlongdouble类型的最大值:" << (numeric_limits<long double>::max)();
}
运行结果
我想要达到的结果
想计算伽马函数,会用到大数阶乘,double类型的话会超过它能够存储的最大值