Home | History | Annotate | Download | only in bigint

Lines Matching refs:BigInteger

10 #include "BigInteger.hh"
15 * - Convenient std::string <-> BigUnsigned/BigInteger conversion routines
16 * - std::ostream << operators for BigUnsigned/BigInteger */
20 std::string bigIntegerToString(const BigInteger &x);
22 BigInteger stringToBigInteger(const std::string &s);
24 // Creates a BigInteger from data such as `char's; read below for details.
26 BigInteger dataToBigInteger(const T* data, BigInteger::Index length, BigInteger::Sign sign);
33 std::ostream &operator <<(std::ostream &os, const BigInteger &x);
38 * Converts binary data to a BigInteger.
51 BigInteger dataToBigInteger(const T* data, BigInteger::Index length, BigInteger::Sign sign) {
52 // really ceiling(numBytes / sizeof(BigInteger::Blk))
54 unsigned int piecesPerBlock = sizeof(BigInteger::Blk) / sizeof(T);
58 BigInteger::Blk *blocks = new BigInteger::Blk[numBlocks];
60 BigInteger::Index blockNum, pieceNum, pieceNumHere;
64 BigInteger::Blk curBlock = 0;
67 curBlock |= (BigInteger::Blk(data[pieceNum]) << (pieceSizeInBits * pieceNumHere));
71 // Create the BigInteger.
72 BigInteger x(blocks, numBlocks, sign);