Class Hierarchy Compound List File List Header Files Compound Members File Members
IInteger Class Reference
provides an infinite size integer class as well as undetermined and signless and signed infinity values.
More...
#include <common/i_integer.h>
List of all members.
Public Members
Static Public Members
- IInteger ii_gcd (const IInteger &op1, const IInteger &op2)
- The following two static functions return the GCD (Greatest Common Denominator) of op1 and op2. More...
- IInteger ii_gcd (const IInteger &op1, const IInteger &op2, IInteger *coeff1, IInteger *coeff2)
- IInteger i_positive_inf (void)
- Return a positive infinity.
- IInteger i_negative_inf (void)
- Return a negative infinity.
- IInteger i_signless_inf (void)
- Return a signless infinity (not the same as positive infinity).
Detailed Description
provides an infinite size integer class as well as undetermined and signless and signed infinity values.
Member Function Documentation
IInteger::IInteger (void)
create an IInteger with indeterminate value.
IInteger::IInteger (signed char initial_value)
IInteger::IInteger (unsigned char initial_value)
IInteger::IInteger (short initial_value)
IInteger::IInteger (unsigned short initial_value)
IInteger::IInteger (int initial_value)
IInteger::IInteger (unsigned int initial_value)
IInteger::IInteger (long initial_value)
IInteger::IInteger (unsigned long initial_value)
Create an IInteger from various types.
IInteger::IInteger (const IInteger & initial_value)
IInteger::IInteger (const char * initial_string, int base = 10)
Convert an ascii string to a value.
-
Parameters:
-
initial_string - string to convert
-
base - base to use. Must be in range 1 to 36
-
NOTE:
-
No prefix (such as 0x for hex) should be present.
-
As well as numeric values, the values ?? (indeterminate
-
+Inf -Inf and Inf are recognized
IInteger::~IInteger ()
bool IInteger::is_undetermined (void) const
Is the iinteger indeterminate?
bool IInteger::is_signless_infinity (void) const
Is the iinteger unsigned infinity? NOTE: There are three infinities, Inf (signless) +Inf and -Inf (signed).
bool IInteger::is_finite (void) const
bool IInteger::is_negative (void) const
Is the iinteger negative?
bool IInteger::is_c_string_int (void) const
Is the integer a string int.
bool IInteger::is_c_char (void) const
Will the value fit in a char.
bool IInteger::is_c_unsigned_char (void) const
Will the value fit in an unsigned char.
bool IInteger::is_c_signed_char (void) const
Will the value fit in a signed char.
bool IInteger::is_c_short (void) const
Will the value fit in a short.
bool IInteger::is_c_unsigned_short (void) const
Will the value fit in an unsigned short.
bool IInteger::is_c_int (void) const
Will the value fit in an int.
bool IInteger::is_c_unsigned_int (void) const
Will the value fit in an unsigned int.
bool IInteger::is_c_long (void) const
Will the value fit in a long.
bool IInteger::is_c_unsigned_long (void) const
Will the value fit in an unsigned long.
bool IInteger::is_c_size_t (void) const
Will the value fit in a size_t.
char * IInteger::c_string_int (void) const
Retrieve value as a string - requires is_c_string \see {to_String}.
char IInteger::c_char (void) const
Retrieve the value as a char - requires is_c_char.
unsigned char IInteger::c_unsigned_char (void) const
Retrieve the value as an unsigned char - requires is_unsigned_c_char.
signed char IInteger::c_signed_char (void) const
Retrieve the value as a signed char - requires is_signed_c_char.
short IInteger::c_short (void) const
Retrieve the value as a short - requires is_c_short.
unsigned short IInteger::c_unsigned_short (void) const
Retrieve the value as an unsigned short - requires is_unsigned_c_short.
int IInteger::c_int (void) const
Retrieve the value as an int - requires is_c_int.
unsigned int IInteger::c_unsigned_int (void) const
Retrieve the value as an unsigned int - requires is_c_unsigned_int.
long IInteger::c_long (void) const
Retrieve the value as a long - requires is_c_long.
unsigned long IInteger::c_unsigned_long (void) const
Retrieve the value as an unsigned long - requires is_c_unsigned_long.
size_t IInteger::c_size_t (void) const
Retrieve the value as a size_t - requires is_c_size_t.
double IInteger::c_double (void) const
Retrieve the value as a double.
Any non-indeterminate non-infinite value can be returned as a double (unless it is enormously large) but precision will be lost if it larger than about 10^16
void IInteger::set_c_char (char new_value)
void IInteger::set_c_unsigned_char (unsigned char new_value)
void IInteger::set_c_signed_char (signed char new_value)
void IInteger::set_c_short (short new_value)
void IInteger::set_c_unsigned_short (unsigned short new_value)
void IInteger::set_c_int (int new_value)
void IInteger::set_c_unsigned_int (unsigned int new_value)
void IInteger::set_c_long (long new_value)
void IInteger::set_c_unsigned_long (unsigned long new_value)
void IInteger::set_c_size_t (size_t new_value)
void IInteger::set_integer (const IInteger & new_value)
void IInteger::clear (void)
Set the value to undetermined.
void IInteger::write (ostream * out, int base = 10) const
Write the value to an ostring.
void IInteger::write (String & str, int base) const
String IInteger::to_String (int base = 10) const
void IInteger::read (const char * location, int base = 10)
void IInteger::read (istream * in, int base = 10)
IInteger IInteger::written_length (int base = 10) const
The old way to write directly to a previously allocated char *.
-
Prefer to_string for new code
-
void IInteger::write (char * location, int base = 10) const
char * IInteger::to_string (int base = 10) const
Output to a char string.
This is allocated from the heap - the caller is responsible for its deletion.
-
use to_String for new code
-
void IInteger::print (ostream * in, int base = 10) const
Appears to duplicate write, but this is not clear - avoid.
bool IInteger::is_divisible_by (const IInteger & other) const
IInteger IInteger::add (const IInteger & other) const
IInteger IInteger::subtract (const IInteger & other) const
IInteger IInteger::multiply (const IInteger & other) const
IInteger IInteger::div (const IInteger & other) const
IInteger IInteger::mod (const IInteger & other) const
IInteger IInteger::negate (void) const
IInteger & IInteger::operator= (const IInteger & other)
bool IInteger::operator== (const IInteger & other) const
bool IInteger::operator!= (const IInteger & other) const
bool IInteger::operator< (const IInteger & other) const
bool IInteger::operator> (const IInteger & other) const
bool IInteger::operator<= (const IInteger & other) const
bool IInteger::operator>= (const IInteger & other) const
bool IInteger::operator== (int other) const
bool IInteger::operator!= (int other) const
bool IInteger::operator< (int other) const
bool IInteger::operator> (int other) const
bool IInteger::operator<= (int other) const
bool IInteger::operator>= (int other) const
bool IInteger::operator== (unsigned int other) const
bool IInteger::operator!= (unsigned int other) const
bool IInteger::operator< (unsigned int other) const
bool IInteger::operator> (unsigned int other) const
bool IInteger::operator<= (unsigned int other) const
bool IInteger::operator>= (unsigned int other) const
bool IInteger::operator== (long other) const
bool IInteger::operator!= (long other) const
bool IInteger::operator< (long other) const
bool IInteger::operator> (long other) const
bool IInteger::operator<= (long other) const
bool IInteger::operator>= (long other) const
bool IInteger::operator== (unsigned long other) const
bool IInteger::operator!= (unsigned long other) const
bool IInteger::operator< (unsigned long other) const
bool IInteger::operator> (unsigned long other) const
bool IInteger::operator<= (unsigned long other) const
bool IInteger::operator>= (unsigned long other) const
IInteger IInteger::operator+ (const IInteger & other) const
IInteger IInteger::operator- (const IInteger & other) const
IInteger IInteger::operator * (const IInteger & other) const
IInteger IInteger::operator/ (const IInteger & other) const
IInteger IInteger::operator% (const IInteger & other) const
IInteger IInteger::operator^ (const IInteger & other) const
IInteger IInteger::operator & (const IInteger & other) const
IInteger IInteger::operator| (const IInteger & other) const
IInteger IInteger::operator~ (void) const
IInteger IInteger::operator<< (const IInteger & other) const
IInteger IInteger::operator>> (const IInteger & other) const
bool IInteger::operator! (void) const
bool IInteger::operator && (const IInteger & other) const
bool IInteger::operator|| (const IInteger & other) const
IInteger IInteger::operator+ (void) const
IInteger IInteger::operator- (void) const
IInteger & IInteger::operator+= (const IInteger & other)
IInteger & IInteger::operator-= (const IInteger & other)
IInteger & IInteger::operator *= (const IInteger & other)
IInteger & IInteger::operator/= (const IInteger & other)
IInteger & IInteger::operator%= (const IInteger & other)
IInteger & IInteger::operator^= (const IInteger & other)
IInteger & IInteger::operator &= (const IInteger & other)
IInteger & IInteger::operator|= (const IInteger & other)
IInteger & IInteger::operator>>= (const IInteger & other)
IInteger & IInteger::operator<<= (const IInteger & other)
IInteger & IInteger::operator++ (void)
IInteger & IInteger::operator-- (void)
IInteger IInteger::operator++ (int)
IInteger IInteger::operator-- (int)
IInteger IInteger::ii_gcd (const IInteger & op1, const IInteger & op2) [static]
The following two static functions return the GCD (Greatest Common Denominator) of op1 and op2.
In addition, the second form sets *coeff1 and *coeff2 to values such that
(op1 * (*coeff1)) + (op2 * (*coeff2)) = GCD.
These coefficients can be extracted by the same algorithm that finds the GCD.
IInteger IInteger::ii_gcd (const IInteger & op1, const IInteger & op2, IInteger * coeff1, IInteger * coeff2) [static]
IInteger IInteger::i_positive_inf (void) [static]
Return a positive infinity.
IInteger IInteger::i_negative_inf (void) [static]
Return a negative infinity.
IInteger IInteger::i_signless_inf (void) [static]
Return a signless infinity (not the same as positive infinity).
Member Data Documentation
long IInteger::long_val
The documentation for this class was generated from the following file:
Generated at Mon Nov 22 19:43:28 1999 for NCI SUIF by
written by Dimitri van Heesch, © 1997-1999