integer
的大小是4,long long int
是8字節,它可以訪問大約19位數據,而對於無符號long long int大小也是8字節,比long long int大,但小於20位。有什麼辦法可以處理超過20位的數據。如何處理大於8字節或超過20位數字的大整數數據在C++中
#include<iostream>
using namespace std;
int main()
{
unsigned long long int a;//any data type more than 8 byte can handle
cin>>a;
if(a>789456123789456123123)//want to take a higher thand this digits
{
cout<<"a is larger and big data"<<endl;
}
}
我搜索一下了一段時間,但並沒有找到有用的contents.All的是java的biginteger
。
[GMP](https://en.wikipedia.org/wiki/GNU_Multiple_Precision_Arithmetic_Library)可以是利益。 –