size of integer
is 4, long long int
is 8 byte and it can access about 19 digits data and for unsigned long long int size also 8 byte but handle larger value than long long int but this is less than 20 digits.Is there any way that can handle over 20 digits data.
#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;
}
}
I searched about it for a while but didn't find helpful contents.All about is java biginteger
.
There are no built-in types larger than unsigned long long
in C++.
You have 2 options:
you can use library to implement that. many libraries are availabe. such as:
For details, see
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.