[bigint] C++ Big Integer Library: small patch

Matthias Rahlf <rahlf at fs.tum.de>
Mon Dec 5 15:50:24 PST 2011


Hi,

I was just playing with my own big integer library as I came across
yours. Congratulations, you are Google's #1 when searching for "bigint
c++".

I ran your code against my testsuite and it did very well. There were
just just two small problems:
When writing out to std::ostream you don't react on std::ios::showpos
and because it writes the minus sign and the number separately your code
does not respect the field width for negative numbers.

Also, your BigInteger / BigUnsigned behaves differently than primitive
types in a few cases: copy assignment, compound assignments and
increase/decrease return void in your code, but usually they return the
new value.

The attached patch fixes all the aforementioned problems /
incompatibilities. Feel free to do with it whatever you want.

Have a nice day,
Matthias
-- 
The best thing about a secret is secretly telling someone your secret,
thereby secretly adding another secret to their secret collection of
secrets, secretly. -Spongebob in Spongebob Squarepants: The Secret Box
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch
URL: <http://mattmccutchen.net/mailman/archives/bigint/attachments/20111206/3d80ef84/attachment.ksh>


More information about the bigint mailing list