Home | History | Annotate | Download | only in bigint

Lines Matching refs:BigInteger

12 /* A BigInteger object represents a signed integer of size limited only by
16 * A BigInteger is just an aggregate of a BigUnsigned and a sign. (It is no
19 class BigInteger {
29 // Enumeration for the sign of a BigInteger.
38 BigInteger() : sign(zero), mag() {}
41 BigInteger(const BigInteger &x) : sign(x.sign), mag(x.mag) {};
44 void operator=(const BigInteger &x);
47 BigInteger(const Blk *b, Index blen, Sign s);
50 BigInteger(const Blk *b, Index blen) : mag(b, blen) {
55 BigInteger(const BigUnsigned &x, Sign s);
58 BigInteger(const BigUnsigned &x) : mag(x) {
63 BigInteger(unsigned long x);
64 BigInteger( long x);
65 BigInteger(unsigned int x);
66 BigInteger( int x);
67 BigInteger(unsigned short x);
68 BigInteger( short x);
100 CmpRes compareTo(const BigInteger &x) const;
103 bool operator ==(const BigInteger &x) const {
106 bool operator !=(const BigInteger &x) const { return !operator ==(x); };
107 bool operator < (const BigInteger &x) const { return compareTo(x) == less ; }
108 bool operator <=(const BigInteger &x) const { return compareTo(x) != greater; }
109 bool operator >=(const BigInteger &x) const { return compareTo(x) != less ; }
110 bool operator > (const BigInteger &x) const { return compareTo(x) == greater; }
113 void add (const BigInteger &a, const BigInteger &b);
114 void subtract(const BigInteger &a, const BigInteger &b);
115 void multiply(const BigInteger &a, const BigInteger &b);
119 void divideWithRemainder(const BigInteger &b, BigInteger &q);
120 void negate(const BigInteger &a);
125 BigInteger operator +(const BigInteger &x) const;
126 BigInteger operator -(const BigInteger &x) const;
127 BigInteger operator *(const BigInteger &x) const;
128 BigInteger operator /(const BigInteger &x) const;
129 BigInteger operator %(const BigInteger &x) const;
130 BigInteger operator -() const;
132 void operator +=(const BigInteger &x);
133 void operator -=(const BigInteger &x);
134 void operator *=(const BigInteger &x);
135 void operator /=(const BigInteger &x);
136 void operator %=(const BigInteger &x);
150 inline BigInteger BigInteger::operator +(const BigInteger &x) const {
151 BigInteger ans;
155 inline BigInteger BigInteger::operator -(const BigInteger &x) const {
156 BigInteger ans;
160 inline BigInteger BigInteger::operator *(const BigInteger &x) const {
161 BigInteger ans;
165 inline BigInteger BigInteger::operator /(const BigInteger &x) const {
168 BigInteger q, r;
173 inline BigInteger BigInteger::operator %(const BigInteger &x) const {
176 BigInteger q, r;
181 inline BigInteger BigInteger::operator -() const {
182 BigInteger ans;
194 inline void BigInteger::operator +=(const BigInteger &x) {
197 inline void BigInteger::operator -=(const BigInteger &x) {
200 inline void BigInteger::operator *=(const BigInteger &x) {
203 inline void BigInteger::operator /=(const BigInteger &x) {
208 BigInteger q;
213 inline void BigInteger::operator %=(const BigInteger &x) {
216 BigInteger q;
221 inline void BigInteger::flipSign() {