How big are the numbers you wants to use?

For example the maximum value a unsigned long integer can store is 4,294,967,295. You can specify it to be bigger ( for example as unsigned long long int ) and then you will a bigger range of values that is able to handle (I am not sure of the exact number, but it would go into trillions).

As far as liibraries are concerned, I am pretty sure there are some math libraries available, so I would recommend running a search on google to look for some.

Cheers.