BCD
|
Public Member Functions | |
BCD (int n=0, int nMax=BLKSIZE) | |
create a BCD object. More... | |
BCD (const BCD &r) | |
~BCD () | |
int | getSize () const |
int | getMaxSize () const |
void | addDigit (T n) |
int | toInt () |
char * | toString () |
int | trailingZeros () |
BCD & | operator= (const BCD &s) |
bool | isZero () const |
int | sumDigits () const |
BCD & | rationalize () |
T & | operator[] (int index) |
T | operator[] (int index) const |
Protected Attributes | |
int | nDigits |
int | nMaxDigits |
int | nValue |
T * | pDigits |
char * | pCharRep |
BCD class implements a BCD number. This can be any number of digits in length. The maxdigits specifies how much room is currently available in the object but the object autogrows (it does not autoshrink)
|
inline |
create a BCD object.
0 | int n= the initial value of the object |
BLKSIZE | int nMax= the number of digits to allocate space for |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
The number of digits in the number.
|
protected |
The number of digits that this object has room for.
|
protected |
integer equivalent; only used when debugging.
|
protected |
used to store the character representation created by toString().