There is a class called FLINT, which can handle with long numbers (up to 1000 digits), I can send it to you.
If have the tutorial in a book, but i can send you a short version of it.
The class' contents are simple mathematial functions, like additon, comparison, square root..)