Home | History | Annotate | Download | only in bigint

Lines Matching defs:BigInteger

7 #include "BigInteger.hh"
9 void BigInteger::operator =(const BigInteger &x) {
19 BigInteger::BigInteger(const Blk *b, Index blen, Sign s) : mag(b, blen) {
38 BigInteger::BigInteger(const BigUnsigned &x, Sign s) : mag(x) {
59 * negative BigInteger instead of an exception. */
62 BigInteger::BigInteger(unsigned long x) : mag(x) { sign = mag.isZero() ? zero : positive; }
63 BigInteger::BigInteger(unsigned int x) : mag(x) { sign = mag.isZero() ? zero : positive; }
64 BigInteger::BigInteger(unsigned short x) : mag(x) { sign = mag.isZero() ? zero : positive; }
70 BigInteger::Blk magOf(X x) {
73 return BigInteger::Blk(x < 0 ? UX(-x) : x);
76 BigInteger::Sign signOf(X x) {
77 return (x == 0) ? BigInteger::zero
78 : (x > 0) ? BigInteger::positive
79 : BigInteger::negative;
83 BigInteger::BigInteger(long x) : sign(signOf(x)), mag(magOf<long , unsigned long >(x)) {}
84 BigInteger::BigInteger(int x) : sign(signOf(x)), mag(magOf<int , unsigned int >(x)) {}
85 BigInteger::BigInteger(short x) : sign(signOf(x)), mag(magOf<short, unsigned short>(x)) {}
91 * BigInteger::convertToUnsignedPrimitive to avoid requiring BigUnsigned to
92 * declare BigInteger. */
99 X BigInteger::convertToUnsignedPrimitive() const {
109 X BigInteger::convertToSignedPrimitive() const {
131 unsigned long BigInteger::toUnsignedLong () const { return convertToUnsignedPrimitive<unsigned long > (); }
132 unsigned int BigInteger::toUnsignedInt () const { return convertToUnsignedPrimitive<unsigned int > (); }
133 unsigned short BigInteger::toUnsignedShort() const { return convertToUnsignedPrimitive<unsigned short> (); }
134 long BigInteger::toLong () const { return convertToSignedPrimitive <long , unsigned long> (); }
135 int BigInteger::toInt () const { return convertToSignedPrimitive <int , unsigned int> (); }
136 short BigInteger::toShort () const { return convertToSignedPrimitive <short, unsigned short>(); }
139 BigInteger::CmpRes BigInteger::compareTo(const BigInteger &x) const {
167 BigInteger tmpThis; \
173 void BigInteger::add(const BigInteger &a, const BigInteger &b) {
207 void BigInteger::subtract(const BigInteger &a, const BigInteger &b) {
208 // Notice that this routine is identical to BigInteger::add,
247 void BigInteger::multiply(const BigInteger &a, const BigInteger &b) {
284 void BigInteger::divideWithRemainder(const BigInteger &b, BigInteger &q) {
290 BigInteger tmpB(b);
366 void BigInteger::negate(const BigInteger &a) {
377 void BigInteger::operator ++() {
389 void BigInteger::operator ++(int) {
394 void BigInteger::operator --() {
406 void BigInteger::operator --(int) {