X-Git-Url: https://mattmccutchen.net/bigint/bigint.git/blobdiff_plain/5ff40cf5d6e822051da902b041ae7ae8f545123e..b9e459aab5aff20564efc14602d214fd4f6a233a:/BigUnsignedInABase.hh diff --git a/BigUnsignedInABase.hh b/BigUnsignedInABase.hh index 3712907..fd596d7 100644 --- a/BigUnsignedInABase.hh +++ b/BigUnsignedInABase.hh @@ -1,7 +1,3 @@ -/* -* Matt McCutchen's Big Integer Library -*/ - #ifndef BIGUNSIGNEDINABASE #define BIGUNSIGNEDINABASE @@ -10,31 +6,31 @@ #include /* -* A BigUnsignedInABase object represents a nonnegative -* integer of size limited only by available memory, -* represented in a user-specified base that can fit in -* an `unsigned short' (most can, and this saves memory). -* -* BigUnsignedInABase is intended as an intermediary class -* with little functionality of its own. BigUnsignedInABase -* objects can be constructed from, and converted to, -* BigUnsigneds (requiring multiplication, mods, etc.) and -* `std::string's (by switching digit values for appropriate -* characters). -* -* BigUnsignedInABase is similar to BigUnsigned. Note the following: -* -* (1) They represent the number in exactly the same way, except -* that BigUnsignedInABase uses ``digits'' (or Digit) where BigUnsigned uses -* ``blocks'' (or Blk). -* -* (2) Both use the management features of NumberlikeArray. (In fact, -* my desire to add a BigUnsignedInABase class without duplicating a -* lot of code led me to introduce NumberlikeArray.) -* -* (3) The only arithmetic operation supported by BigUnsignedInABase -* is an equality test. Use BigUnsigned for arithmetic. -*/ + * A BigUnsignedInABase object represents a nonnegative + * integer of size limited only by available memory, + * represented in a user-specified base that can fit in + * an `unsigned short' (most can, and this saves memory). + * + * BigUnsignedInABase is intended as an intermediary class + * with little functionality of its own. BigUnsignedInABase + * objects can be constructed from, and converted to, + * BigUnsigneds (requiring multiplication, mods, etc.) and + * `std::string's (by switching digit values for appropriate + * characters). + * + * BigUnsignedInABase is similar to BigUnsigned. Note the following: + * + * (1) They represent the number in exactly the same way, except + * that BigUnsignedInABase uses ``digits'' (or Digit) where BigUnsigned uses + * ``blocks'' (or Blk). + * + * (2) Both use the management features of NumberlikeArray. (In fact, + * my desire to add a BigUnsignedInABase class without duplicating a + * lot of code led me to introduce NumberlikeArray.) + * + * (3) The only arithmetic operation supported by BigUnsignedInABase + * is an equality test. Use BigUnsigned for arithmetic. + */ class BigUnsignedInABase : protected NumberlikeArray { @@ -80,21 +76,21 @@ class BigUnsignedInABase : protected NumberlikeArray { operator BigUnsigned() const; /* LINKS TO STRINGS - * - * These use the symbols ``0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'' to represent - * digits of 0 through 35. When parsing strings, lowercase is also accepted. - * - * All string representations are big-endian (big-place-value digits first). - * (Computer scientists have adopted zero-based counting; why can't they - * tolerate little-endian numbers? It makes a lot of sense!) - * - * No string representation has a ``base indicator'' like ``0x''. - * - * An exception is made for zero: it is converted to ``0'' and not the empty string. - * - * If you want different conventions, write your - * own routines to go between BigUnsignedInABase and strings. It's not hard. - */ + * + * These use the symbols ``0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'' to represent + * digits of 0 through 35. When parsing strings, lowercase is also accepted. + * + * All string representations are big-endian (big-place-value digits first). + * (Computer scientists have adopted zero-based counting; why can't they + * tolerate little-endian numbers? It makes a lot of sense!) + * + * No string representation has a ``base indicator'' like ``0x''. + * + * An exception is made for zero: it is converted to ``0'' and not the empty string. + * + * If you want different conventions, write your + * own routines to go between BigUnsignedInABase and strings. It's not hard. + */ operator std::string() const; BigUnsignedInABase(const std::string &s, Base base);