ln3 Method - IsOdd, IsEven
Description
Determine if the large number is odd or even. These function are slightly more efficient than using one of the bit operations. They are considerably more efficient than using the
mod
operator.
Signature
bool IsOdd( void ) const
bool IsEven( void ) const
Parameters
( none )
Returns
( bool )
true
if the large number is odd (even);
false
otherwise.
Example
If the value in the variable
X
is odd, then print out the string
X is odd
:
ln X; ... if( X.IsOdd( ) ) cout << "X is odd" << endl;