Sitemap | Search || Zen Spider Website
/ Satori
/ Satori Class Index
/ Class UInteger
Class UInteger
-
- Define a "plug & play" unsigned integer class in order to
- catch any and all improper arithmetic errors such as
- overflow, underflow, division by zero, etc...
- Methods
- Constructors
-
-
-
-
-
- (unsigned long value = 0L);
- This constructer assigns the object 'value' which defaults to zero.
-
-
-
-
- (const SInteger &);
- This is the conversion constructor and allows the compiler to make a copy
- of an SInteger object.
-
-
-
-
- (const UInteger &);
- This is the copy constructor and allows the compiler to make a copy
- of another UInteger object.
-
-
-
-
- ();
- This is the destuctor for the class UInteger. It sets the object's
- value to zero.
- Assignment & Conversions
-
- UInteger.
-
- UInteger.
-
-
- unsigned long
-
- ();
- This returns the objects value as an unsigned long.
- Simple Arithmetic
-
- (const UInteger & rhs);
- The '+' operator checks for overflow, then adds two UIntegers.
-
- const UInteger operator
-
- (const UInteger & rhs);
- The '-' operator checks for underflow, then subtracts two UIntegers.
-
- const UInteger operator
-
- (const UInteger & rhs);
- The '*' operator checks for overflow, then multplies two UIntegers.
-
- const UInteger operator
-
- (const UInteger & rhs);
- The '/' operator checks for division by zero, then divides two
UIntegers.
-
- const UInteger operator
-
- (const UInteger & rhs);
- The modulo operator checks for division by zero, then Mods two
UIntegers.
Bitwise Arithmetic
-
- const UInteger operator
-
- (const UInteger & rhs);
- The shift left operator asserts that the shift is not larger than
the number of bits in an an unsigned long. It returns a UInteger.
shifted left by the desired amount.
-
- const UInteger operator
-
- (const UInteger & rhs);
- The shift right operator asserts that the shift is not larger than
the number of bits in an an unsigned long. It returns a UInteger.
shifted right by the desired amount.
Arithmetic Assignment
UInteger.
UInteger.
UInteger.
-
- UInteger &
-
- (const UInteger & rhs);
- The '%=' operator takes the result of the division of two UIntegers
and assigns the result to the this UInteger.
Bitwise Arithmetic Assignment
the this UInteger. This asserts that the shift is not larger than
the number of bits in an an unsigned long.
the this UInteger. This asserts that the shift is not larger than
the number of bits in an an unsigned long.
Increment & Decrement:
-
- UInteger &
-
- ();
- The Prefix increment takes no arguments. It increases the UInteger
by one before the object is used. This asserts that myValue is not
max.
-
- const UInteger operator
-
- (int x);
- The Postfix increment takes no arguments. It increases the UInteger
by one after the object is used. This asserts that myValue is not
max.
-
- UInteger &
-
- ();
- The Prefix decrement takes no arguments. It decreases the UInteger
by one before the object is used. This asserts that myValue is not
zero.
-
- const UInteger operator
-
- (int x);
- The Postfix decrement takes no arguments. It decreases the UInteger
by one after the object is used. This asserts that myValue is not
zero.
Boolean Logic
-
- const Boolean operator
-
- (const UInteger & rhs);
- The less than operator compares two UIntegers and returns a Boolean.
The Boolean is true if this UInteger is less than 'rhs', false
otherwise.
-
- const Boolean operator
-
- (const UInteger & rhs);
- The greater than operator compares two UIntegers and returns a
Boolean. The Boolean is true if this UInteger is greater than than
'rhs', false otherwise.
-
- const Boolean operator
-
- (const UInteger & rhs);
- The less than or equal to operator compares two UIntegers and
returns a Boolean. The Boolean is true if this UInteger is less than
or equal to 'rhs', false otherwise.
-
- const Boolean operator
-
- (const UInteger & rhs);
- The greater than or equal to operator compares two UIntegers and
returns a Boolean. The Boolean is true if this UInteger is greater
than or equal to 'rhs', false otherwise.
-
- const Boolean operator
-
- (const UInteger & rhs);
- The equality operartor compares two UIntegers and returns a Boolean.
The Boolean is true if this UInteger is equal to 'rhs', false
otherwise.
-
- const Boolean operator
-
- (const UInteger & rhs);
- The not equals to operator compares two UIntegers and returns a
Boolean. The Boolean is true if this UInteger is not equal to 'rhs',
false otherwise.
This is the test driver. It massages every possible use of UInteger,
both good input and bad...
Static Data
-
-
- unsigned long
-
- myValue is an unsigned long. It is accessed only inside the
UInteger because it is protected data.
Sitemap | Search || Zen Spider Website
/ Satori
/ Satori Class Index
/ Class UInteger