[bigint] Initialisation of BigInteger

Matt McCutchen <matt at mattmccutchen.net>
Fri Oct 10 04:22:23 PDT 2008


On Fri, 2008-10-10 at 11:30 +0530, swagat konchada wrote:
> How can I initialize a BigInteger with a numbe say, 600851475143?

The easiest way to initialize a BigInteger with a number that is too
large to be a primitive integer literal is to convert from a string, as
shown in sample.cc:

std::string s("3141592653589793238462643383279");
BigInteger f = stringToBigInteger(s);

Matt




More information about the bigint mailing list