Originally posted by: Sergio Juan Membiela
Hi.
I've found some strange behaviour when testing this class:
- given two CBigInt from two char[], containing both "12345678901234567890", and adding them together, gives me (when using Format()) the char[] "2469135782469135780" instead of "24691357802469135780" (note that the middle '0' is missing)
- given two CBigInt from two char[], containing both "1000000010", the result of adding them is "200000002"
instead of "2000000020".
I was working on Vc5 on Windows 2000.
If you need the code I used to test it, feel free to contact.
Regards.
ReplyOriginally posted by: Michael B. Pliam
This library would be great were it not for the apparent memory leak. By simply instantiating a CBigInt object, either using CBigInt bb or CBigInt aa("123234345"), one can detect a memory leak from a console app using the #include <crtdbg.h> and _CrtDumpMemoryLeaks(); within the main() function.
Any idea how one might fix this? Thanks for sharing.
Modified January 31, 2002
My mistake. It does not leak. My debugging code was wrong. If you want to know how I made such a mistake, see
http://codeguru.earthweb.com/cgi-bin/bbs/wt/showpost.pl?Board=vc&Number=339009&page=&view=&sb=&category=
Originally posted by: Martin
Nice peace of work! I only have one question: Could you explain the parameters of the format functions? I understand what the 'Radix' does, but what about 'char *szBuf', 'unsigned long cbBuf' and 'unsigned long *pNeeded'?
Thanks,
Martin
Reply
Originally posted by: Kevin Miller
I believe that the defacto standard among the big number fanatics is the GNU Multi Precision library (GMP).
How does yours compare in terms of performance?
in terms of code size?
in terms of ease of use?