I decided to delete whitespace from otherwise empty lines.
[bigint/bigint.git] / BigUnsignedInABase.hh
index 4096907..3712907 100644 (file)
 */
 
 class BigUnsignedInABase : protected NumberlikeArray<unsigned short> {
-       
+
        // TYPES
        public:
        typedef unsigned short Digit; // The digit type that BigUnsignedInABases are built from
        typedef Digit Base;
-       
+
        // FIELDS
        protected:
        Base base; // The base of this BigUnsignedInABase
-       
+
        // MANAGEMENT
        protected:
        // These members generally defer to those in NumberlikeArray, possibly with slight changes.
        // It might be nice if one could request that constructors be inherited in C++.
-       
+
        BigUnsignedInABase(int, Index c) : NumberlikeArray<Digit>(0, c) {} // Creates a BigUnsignedInABase with a capacity
-       
+
        void zapLeadingZeros() { // Decreases len to eliminate leading zeros
                while (len > 0 && blk[len - 1] == 0)
                        len--;
        }
-       
+
        //void allocate(Index c); // (NlA) Ensures the number array has at least the indicated capacity, maybe discarding contents
        //void allocateAndCopy(Index c); // (NlA) Ensures the number array has at least the indicated capacity, preserving its contents
-       
+
        public:
        BigUnsignedInABase() : NumberlikeArray<Digit>(), base(2) {} // Default constructor (value is 0 in base 2)
        BigUnsignedInABase(const BigUnsignedInABase &x) : NumberlikeArray<Digit>(x), base(x.base) {} // Copy constructor
-       
+
        void operator =(const BigUnsignedInABase &x) { // Assignment operator
                NumberlikeArray<Digit>::operator =(x);
                base = x.base;
        }
-       
+
        BigUnsignedInABase(const Digit *d, Index l) : NumberlikeArray<Digit>(d, l) { // Constructor from an array of digits
                zapLeadingZeros();
        }
-       
+
        // LINKS TO BIGUNSIGNED
        BigUnsignedInABase(const BigUnsigned &x, Base base);
        operator BigUnsigned() const;
-       
+
        /* LINKS TO STRINGS
        *
        * These use the symbols ``0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'' to represent
@@ -97,7 +97,7 @@ class BigUnsignedInABase : protected NumberlikeArray<unsigned short> {
        */
        operator std::string() const;
        BigUnsignedInABase(const std::string &s, Base base);
-       
+
        // PICKING APART
        // These accessors can be used to get the pieces of the number
        public:
@@ -109,7 +109,7 @@ class BigUnsignedInABase : protected NumberlikeArray<unsigned short> {
        Digit getDigit(Index i) const { return i >= len ? 0 : blk[i]; }
        // Note how we replace one level of abstraction with another.
        bool isZero() const { return NumberlikeArray<Digit>::isEmpty(); } // Often convenient for loops
-       
+
        // EQUALITY TEST
        public:
        // Equality test
@@ -117,7 +117,7 @@ class BigUnsignedInABase : protected NumberlikeArray<unsigned short> {
                return base == x.base && NumberlikeArray<Digit>::operator ==(x);
        }
        bool operator !=(const BigUnsignedInABase &x) const { return !operator ==(x); }
-       
+
 };
 
 #endif