BCD
 All Classes Files Functions Variables Typedefs Macros
main.cpp File Reference
#include <iostream>
#include <ctime>

Classes

class  BCD
 

Macros

#define WATCH(x)
 
#define BLKSIZE   100
 

Typedefs

typedef int T
 

Functions

int max (int l, int r)
 returns the maximum of two values More...
 
int min (int l, int r)
 returns the minimumof two values More...
 
BCD operator+ (const BCD &l, const BCD &r)
 
int compareWShift (const BCD &l, const BCD &r, int shift=0)
 
bool operator> (const BCD &l, const BCD &r)
 
bool operator< (const BCD &l, const BCD &r)
 
bool operator== (const BCD &l, const BCD &r)
 
bool operator>= (const BCD &l, const BCD &r)
 
bool operator<= (const BCD &l, const BCD &r)
 
BCD subWShift (BCD &l, const BCD &r, int shift=0)
 
BCD operator- (const BCD &l, const BCD &r)
 
BCD operator* (const BCD &l, const BCD &r)
 
BCD operator/ (const BCD &n, const BCD &d)
 
BCD BCDFactorial (int f)
 
unsigned long factorial (unsigned long n)
 
int main ()
 

Variables

T remainders [100]
 
T modulas [100]
 

Macro Definition Documentation

#define BLKSIZE   100
#define WATCH (   x)

Typedef Documentation

typedef int T

T defines the storage type of a BCD digit. This can be any of the integer types; (int, unsigned int, char, unsigned char, UINT8, etc.) the only two that make much sense are int and char

Function Documentation

BCD BCDFactorial ( int  f)
int compareWShift ( const BCD l,
const BCD r,
int  shift = 0 
)
unsigned long factorial ( unsigned long  n)
int main ( )
int max ( int  l,
int  r 
)

returns the maximum of two values

Parameters
lint
rint
Returns
int
int min ( int  l,
int  r 
)

returns the minimumof two values

Parameters
lint
rint
Returns
int
BCD operator* ( const BCD l,
const BCD r 
)
BCD operator+ ( const BCD l,
const BCD r 
)
BCD operator- ( const BCD l,
const BCD r 
)
BCD operator/ ( const BCD n,
const BCD d 
)
bool operator< ( const BCD l,
const BCD r 
)
bool operator<= ( const BCD l,
const BCD r 
)
bool operator== ( const BCD l,
const BCD r 
)
bool operator> ( const BCD l,
const BCD r 
)
bool operator>= ( const BCD l,
const BCD r 
)
BCD subWShift ( BCD l,
const BCD r,
int  shift = 0 
)

Variable Documentation

T modulas[100]
Initial value:
= {0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9}
T remainders[100]
Initial value:
= {0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9}