1 #ifndef BIGINTEGERUTILS_H
2 #define BIGINTEGERUTILS_H
47 unsigned int pieceSizeInBits = 8 *
sizeof(T);
49 unsigned int numBlocks = (length + piecesPerBlock - 1) / piecesPerBlock;
57 for (blockNum = 0, pieceNum = 0; blockNum < numBlocks; blockNum++) {
59 for (pieceNumHere = 0; pieceNumHere < piecesPerBlock && pieceNum < length;
60 pieceNumHere++, pieceNum++)
61 curBlock |= (
BigInteger::Blk(data[pieceNum]) << (pieceSizeInBits * pieceNumHere));
62 blocks[blockNum] = curBlock;
BigUnsigned stringToBigUnsigned(const std::string &s)
BigInteger dataToBigInteger(const T *data, BigInteger::Index length, BigInteger::Sign sign)
BigInteger stringToBigInteger(const std::string &s)
std::string bigUnsignedToString(const BigUnsigned &x)
std::ostream & operator<<(std::ostream &os, const BigUnsigned &x)
std::string bigIntegerToString(const BigInteger &x)