0

the problem is- it is required to

store 'big integers'(more than alloted space for integers), suggest a

suitable method by which big integers can be stored , also device an

algorithm for adding of such numbers..


the just need the method of achieving this.i can write the code in any language i just need the logic

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Banfa
0

The logic is to store digits rather than the whole integer. then you do addition in the same way you used to do it when you where 10 years old, one column at a time.

Of course although you are storing digits you can choose the base to make effective use of your data type so rather than base 10 you could use something like base 65536 and use a 32bit int to store each digit.

0

thank u.. but is there a better method? according to above the program would be too long and complex. i am using C

0

No that is the best method in my opinion and its not very complex given that it only involves elementary school mathematics and lends itself easily to an iterative solution.

If you are using C why are you posting in C++?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.