Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

data structure for adding very large numbers?

Tags:

c

how will you add numbers like 1234567890123456789012345678901234567890, which can't be specified using primitive data types? what kind of data structure will you use?

like image 970
user259107 Avatar asked Jan 26 '10 09:01

user259107


1 Answers

You will need a C library that implements arbitrary-precision arithmetic. There are many to choose from. One popular choice is GNU Multi-Precision Library.

like image 131
sleske Avatar answered Sep 28 '22 23:09

sleske