Working with extremely large numbers in C

Hi All,

I am just curious, not programming anything of my own. I know there are libraries like gmp which does all such things. But I really need to know HOW they do all such things i.e. working with extremely large unimaginable numbers which are beyond the integer limit. They can do add, subtract etc.

I have thought of one way which is instead of int, store the numbers in the character array of any length and while computing, keep changing each and every char to int and hence perform an operation.

Are there any other better ways of handling large integers in C program?

Use objects (struct, array) of integers, implementing carry operations in software rather than in hardware.

1 Like