17 throw "BigInteger::BigInteger(const Blk *, Index, Sign): Cannot use a sign of zero with a nonzero magnitude";
28 throw "BigInteger::BigInteger(const Blk *, Index, Sign): Invalid sign";
36 throw "BigInteger::BigInteger(const BigUnsigned &, Sign): Cannot use a sign of zero with a nonzero magnitude";
47 throw "BigInteger::BigInteger(const BigUnsigned &, Sign): Invalid sign";
63 template <
class X,
class UX>
95 throw "BigInteger::to<Primitive>: "
96 "Cannot convert a negative integer to an unsigned type";
98 return convertBigUnsignedToPrimitiveAccess<X>(
mag);
103 template <
class X,
class UX>
112 if (x >= 0 &&
Blk(x) == b)
118 if (x < 0 &&
Blk(UX(-x)) == b)
123 throw "BigInteger::to<Primitive>: "
124 "Value is too big to fit in the requested type";
152 throw "BigInteger internal error";
161 #define DTRT_ALIASED(cond, op) \
163 BigInteger tmpThis; \
284 throw "BigInteger::divideWithRemainder: Cannot write quotient and remainder into the same variable";
285 if (
this == &b || &q == &b) {
unsigned long toUnsignedLong() const
BigUnsigned::CmpRes CmpRes
void negate(const BigInteger &a)
CmpRes compareTo(const BigUnsigned &x) const
X convertToPrimitive() const
static const CmpRes greater
void divideWithRemainder(const BigUnsigned &b, BigUnsigned &q)
CmpRes compareTo(const BigInteger &x) const
void operator=(const BigInteger &x)
void add(const BigUnsigned &a, const BigUnsigned &b)
unsigned short toUnsignedShort() const
X convertToUnsignedPrimitive() const
void subtract(const BigUnsigned &a, const BigUnsigned &b)
static const CmpRes equal
void add(const BigInteger &a, const BigInteger &b)
X convertToSignedPrimitive() const
#define DTRT_ALIASED(cond, op)
void multiply(const BigUnsigned &a, const BigUnsigned &b)
unsigned int toUnsignedInt() const
Blk getBlock(Index i) const
X convertBigUnsignedToPrimitiveAccess(const BigUnsigned &a)
void divideWithRemainder(const BigInteger &b, BigInteger &q)
void multiply(const BigInteger &a, const BigInteger &b)
void subtract(const BigInteger &a, const BigInteger &b)