Page 1 of 1
Posted: Fri Nov 22, 2002 4:44 am
What are the most efficient ways of taking
1. int to string
2. string to int
3. string addtion
4. string multiplication
Try algorithm thread
Posted: Fri Nov 22, 2002 12:09 pm
Why don't you try the algorithm thread and see the post on BigInteger. I think this may help you. If you want to implement one of your own, see D.E.Knuth TAOCP, Volume2 Seminumerical Algorithm.
Posted: Mon Nov 25, 2002 1:37 am
Hi! Suman & Rajib!
Suman your class implementation is good but as Rajib has sended it in C thread so you may think that he needs the functions which is supported by C only, not C++.
Besides your class is too big for real time contests isn't it?
If you are familiar with C++ class routines you may try with his class which is really good as a "Class"!!!
Posted: Tue Nov 26, 2002 7:35 pm
You are right moni the code is BIG, but if one understand the whole thing then its easy to chop the unwanted portion of the code during the contest. And sorry to rajib if I bothered you indicating the `thing'. However here is a url where you will get some very good implemntation of big number, both in C & C++.
http://www.mirrors.wiretapped.net/secur ... aries/math
An also try searching in http://www.sourceplanet.com