15,937,127 members
See more:
Hi everyone, I need a method for divide two big numbers in string,( console app. and in c++ )
for example :
string s1 = "4234823759252523523502525234232"...( about 100 char numbers )"
string s2 = "243423423423"...also like above"

string Result = Divide(s1,s2);

Thank you.
Posted
joshrduncan2012 8-Apr-13 16:26pm
[no name] 10-Apr-13 6:09am
yes, but my problem didn't solve there(Google). :D
Matt T Heffron 8-Apr-13 16:44pm
How would you do it if you wrote the numbers out on paper and did the "long division"?
Well, that's what you need to code.
Give that a try and if you have specific problems with the implementation, then ask for help here.
[no name] 10-Apr-13 6:07am
i did those things and i coded this method, actually i programmed a console app. that has 4 methods ; sum minus multiply divide for BIG numbers in string format and the main method, i felt something went wrong when i saw the whole program has 400 linen, is that too much or ....
thank you anyway for answering, Matt T Heffron
Matt T Heffron 10-Apr-13 13:00pm
Congratulations!
400 lines does not seem like a seriously excessive length.
An experienced programmer could probably trim off a bit.

## Solution 1

This is a well-known problem related to some class which is usually called "BigInteger" or "BigInt".

These are some of the implementations:
http://sourceforge.net/projects/cpp-bigint/[^],
https://mattmccutchen.net/bigint/[^],
https://github.com/technophilis/BigIntegerCPP[^].

You can try to find some more: http://lmgtfy.com/?q=C%2B%2B+(BigInteger+OR+BigInt)[^].

—SA