X-Git-Url: https://mattmccutchen.net/bigint/bigint.git/blobdiff_plain/b35b69671758932989823d1912627c4c2507792c..83a639e66e094c683b48215a895f6d35e9d60d32:/BigUnsignedInABase.hh diff --git a/BigUnsignedInABase.hh b/BigUnsignedInABase.hh index c279826..6925151 100644 --- a/BigUnsignedInABase.hh +++ b/BigUnsignedInABase.hh @@ -35,16 +35,16 @@ class BigUnsignedInABase : protected NumberlikeArray { // TYPES - public: +public: typedef unsigned short Digit; // The digit type that BigUnsignedInABases are built from typedef Digit Base; // FIELDS - protected: +protected: Base base; // The base of this BigUnsignedInABase // MANAGEMENT - protected: +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++. @@ -58,7 +58,7 @@ class BigUnsignedInABase : protected NumberlikeArray { //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: +public: BigUnsignedInABase() : NumberlikeArray(), base(2) {} // Default constructor (value is 0 in base 2) BigUnsignedInABase(const BigUnsignedInABase &x) : NumberlikeArray(x), base(x.base) {} // Copy constructor @@ -96,7 +96,7 @@ class BigUnsignedInABase : protected NumberlikeArray { // PICKING APART // These accessors can be used to get the pieces of the number - public: +public: Base getBase() const { return base; } NumberlikeArray::getCapacity; // (NlA) NumberlikeArray::getLength; // (NlA) @@ -107,7 +107,7 @@ class BigUnsignedInABase : protected NumberlikeArray { bool isZero() const { return NumberlikeArray::isEmpty(); } // Often convenient for loops // EQUALITY TEST - public: +public: // Equality test bool operator ==(const BigUnsignedInABase &x) const { return base == x.base && NumberlikeArray::operator ==(x);