You are here:

C++/handling extreme large numbers in c++


dear sir,
I am a student of M.Sc(maths)from IIT(DELHI).
i am doing a project on cryptography.related to that i want to find quadratic residues for extreme large no.(like 100 digits or more).my problem is how to  deal with such long numbers in c++.

Hello Sandeep,

Here is a solution I found on that may be useful to you:

That will allow you to manipulate extremely large numbers by creating custom classes and overloading the arithmetic operators. You'll basically be taking in the numbers as a string, and converting / processing them in your functions.

I hope that's at least a little helpful. Please let me know if you'd like a bit of help implementing this solution, I'll be more than happy to give you a hand.

good luck!


All Answers

Answers by Expert:

Ask Experts


Sean Wcisel


I can answer most beginner and intermediate level questions. My strengths are various algorithms and data manipulation. My background might be best suited to anything from basic CPP and file I/O, to algorithms involving recursion, hashing, binary search trees, and so on. I've done some tutoring in my free time, both online and in person. I also have quite a bit of debugging experience. I have some experience with game code, specifically using D3D based game engines. I only speak English, but I believe I do so very well :). I'm completely unable to answer questions about coding drivers for hardware, and many library specific issues.


I've studied CPP for roughly four years now, with a combined eight years of object oriented programming experience. I have worked professionally in the field for about a year. I have also had some tutoring experience in CPP and C#

IEEE, Western Michigan University Computer Club

Western Michigan University

©2016 All rights reserved.