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:
Gmplib
bigint
For details, see
Arbitrary-precision_arithmetic#Libraries
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With