ln3 Method - Compare, CompareAbs
Description
Compare two large integers. CompareAbs ignores the sign of the numbers.
Signature
compare_t Compare( const ln &A )
compare_t CompareAbs( const ln &A )
Parameters
Name
Type
Description
A
ln
The number to be compared to
*this.
Returns
( compare_t ) An enumerated constant indicating the relationship between A and *this. The value will be one of: equalTo, lessThan, or greaterThan.
Example
If the value in the variable
X
is equal to the value in the variable
Y
, print out the string
X is equal to Y
:
ln X = 123; ln Y = 234; if( X.Compare( Y ) == equalTo ) cout << "X is equal to Y" << endl;
Notes
The type
compare_t
is declared in the header
base.h
.