0

Storing very large number in C programming

I want to store very large number suppose Avogadro's number which is 6.022*10^23. Even long double overflows when i try to store it. In Python it is quite easy as it will just store any data type and will not show any error. Any help is appreciated 😁 !

13th Dec 2019, 3:29 AM
Ashutosh B. Rajan
Ashutosh B. Rajan - avatar
1 Answer
+ 1
Unfortunately, you must use an external library: https://wikipedia.org/wiki/List_of_arbitrary-precision_arithmetic_software In C++ the job could be easier if you use an "header only" extension: there are 2 or 3 around.
13th Dec 2019, 5:46 AM
Bilbo Baggins
Bilbo Baggins - avatar