By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,720 Members | 2,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,720 IT Pros & Developers. It's quick & easy.

how to handle big numbers uisng string?

P: 3
Hello there,
I am working with a problem that needs arithmetic manipulation with big numbers. I am trying to using string to store big numbers, but not sure how to use them for arithmetic operation. Can anybody give me any help link that shows some arithmetic manipulation using string encoded big integers?
thx in advance
Sep 17 '10 #1
Share this Question
Share on Google+
3 Replies


Expert 100+
P: 2,400
What arithmetic operations do you have to perform? It would be a lot easier if you only have to do addition and subtraction.
Sep 17 '10 #2

P: 3
I need to perform some GCD operations. Can you please also post some examples for addition,subtraction,multiplication and division? those helps will be much appreciated..
Sep 17 '10 #3

weaknessforcats
Expert Mod 5K+
P: 9,197
You will need to write functions to add, subtract, divide and multiply your strings.

If you are using C++ you can overload the +, -, / and * operators.

If you are using C you will need to call your functions all the time and never use the +, -, / and * operators.

There are big number libraries already written and aa quick Google will point you to them.
Sep 18 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.