[bigint] Big Integer library suggestion

Amit X Srivastava <Amit.Srivastava at abbott.com>
Thu May 27 15:00:17 PDT 2010


Hi Matt,

Thanks for posting your big integer library as open source.  I have posted 
a symbolic algebra library in the past, using GNU's GPL.  After reading 
your converstaion with Constantin Berzan, I may switch to publishing open 
source in the future.  The Google CodeJam programming contest ran a 
problem this year, "Fair Warning", which required big integer arithmetic, 
and promised more to come in the future, so hopefully that drives many 
more people to your library.

I just wanted to suggest a trivial edit to the code.  It's not even in the 
main library per se, but in testsuite.cc.  Please see below.  Thanks, and 
happy coding!

-- Amit Srivastava


Current code:

// Evaluate expr and print the result or "error" as appropriate.
#define TEST(expr) do {\
        cout << "Line " << __LINE__ << ": ";\
        try {\
                cout << (expr);\
        } catch (const char *err) {\
                cout << "error: ";\
        }\
        cout << endl;\
} while (0)

Suggested change (bold and underlined) to display the error, in for no 
other reason than to avoid the "unreferenced local variable 'err'" 
warning:

// Evaluate expr and print the result or "error" as appropriate.
#define TEST(expr) do {\
        cout << "Line " << __LINE__ << ": ";\
        try {\
                cout << (expr);\
        } catch (const char *err) {\
                cout << "error: " << err;\
        }\
        cout << endl;\
} while (0)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mattmccutchen.net/mailman/archives/bigint/attachments/20100527/97545dfd/attachment.htm>


More information about the bigint mailing list