+ 3
Is there any way to calculate numbers beyond the 32bit integer limit in C++?
Can we calculate/display numbers numbers which are the beyond the 32bit integer limit (2,147,483,647) ? Is there any code to do so? If our computers are 64bit, then why can't a variable store upto 64bit value?
3 ответов
+ 6
This will help you:
https://www.geeksforgeeks.org/bigint-big-integers-in-c-with-example/
+ 3
Sanvi Kaviskar in the compiler used by Sololearn you can get 64 bits of integer precision by using intrinsic datatypes. On other architectures and compilers the sizes may be different. Here I have listed the available bits by type:
# Bits of Precision:
8 (char)
8 (unsigned char)
15 (short int)
16 (unsigned short int)
31 (int)
32 (unsigned int)
63 (long int)
63 (long long int)
64 (unsigned long int)
64 (unsigned long long int)
Beyond that, go with BigInt as suggested by JaScript.
0
you can also create a data type for large numbers