Page 1 of 1

How To

Posted: Fri Nov 22, 2002 4:44 am
by Rajib Mazumder
Hey All
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
by suman
Hi,
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.

Bye.


- Suman

Posted: Mon Nov 25, 2002 1:37 am
by Moni
Hi! Suman & Rajib!
:D 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?

Rajib,
If you are familiar with C++ class routines you may try with his class which is really good as a "Class"!!! :wink:

Some URL

Posted: Tue Nov 26, 2002 7:35 pm
by suman
Hi,
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

Good luck.

- Suman