NumericValues

Classes used for numeric values. More...

Classes

class  CASNumeric
 Base class for providing an interface to numeric CASObject. More...
class  LongInt
 Implements a arbitrary precision integer. More...

Enumerations

enum  signedness { Positive = 0, Negative = 1 }
 Indicates the signedness of the numerical value. More...

Functions

CASObjectLongInt::Absolute () const
 Returns the absolute value.
CASObjectLongInt::Add (const CASObject *addend) const
 Adds another CASObject to the LongInt.
CASObjectLongInt::Clone () const
 Clones the LongInt.
CASObjectLongInt::Divide (const CASObject *divisor) const
 Divides the LongInt by another CASObject.
CASObjectLongInt::Evaluate () const
 Evaluates the LongInt.
LongInt LongInt::FractionalPart (signed long r) const
 Returns the fractional part of the division.
LongInt LongInt::FractionalPart (const LongInt &r) const
 Returns the fractional part of the division.
unsigned long LongInt::frontpartlength () const
 Returns the lenght in string representation of the front group.
CASObjectLongInt::GCD (const CASObject *i) const
 Computes the GCD of the LongInt and another CASObject.
void LongInt::Get (std::string &s) const
 Returns the LongInt as std::string.
void LongInt::Get (char *s, unsigned long size) const
 Returns the LongInt as string.
void LongInt::Get (char **s) const throw ( EInvArg, EUninitializedPtr )
 Returns the LongInt in string representation.
signedness CASNumeric::GetSign () const
 Returns the sign.
CASObjectLongInt::Invert () const
 Returns the value with inverted sign.
bool LongInt::IsEqual (const CASObject *o) const
 Indicates whether or not the LongInt is equal to another CASObject.
bool LongInt::IsGT (const CASObject *o) const
 Indicates whether or not the LongInt is greater than another CASObject.
bool LongInt::IsLT (const CASObject *o) const
 Indicates whether or not the LongInt is less than another CASObject.
bool LongInt::IsOne () const
 Indicates whether or not it is one.
bool LongInt::IsSimilar (const CASObject *o) const
 Indicates whether or not the LongInt is similar to another CASObject.
bool LongInt::IsZero () const
 Indicates whether or not it is zero.
unsigned long LongInt::Length () const
 Returns the length of the LongInt in terms of digits.
 LongInt::LongInt (const LongInt &r)
 Copy constructor.
 LongInt::LongInt (const std::string &s)
 Constructor.
 LongInt::LongInt (const char *s)
 Constructor.
 LongInt::LongInt (signed long l=0)
 Constructor.
void LongInt::longint2str (char *s, unsigned long size) const
 Converts the LongInt to a C-string.
CASObjectLongInt::Modulo (const CASObject *divisor) const
 Calculates the modulus.
CASObjectLongInt::Multiply (const CASObject *fact) const
 Multiplies the LongInt by another CASObject.
void LongInt::num2longint (const signed long num)
 Converts an integer to a LongInt.
const LongInt LongInt::operator * (const long &r) const
 Multiplication operator.
const LongInt LongInt::operator * (const LongInt &r) const
 Multiplication operator.
LongIntLongInt::operator *= (const signed long &r)
 Multiplication assignment operator.
LongIntLongInt::operator *= (const LongInt &r)
 Multiplication assignment operator.
const bool LongInt::operator!= (const long &r) const
 Not equal operator.
const bool LongInt::operator!= (const LongInt &r) const
 Not equal operator.
const LongInt LongInt::operator% (const long &r) const
 Modulo operator.
const LongInt LongInt::operator% (const LongInt &r) const
 Modulo operator.
LongIntLongInt::operator%= (const signed long &r)
 Modulus assignment operator.
LongIntLongInt::operator%= (const LongInt &r)
 Modulus assignment operator.
const LongInt LongInt::operator+ (const long &r) const
 Addition operator.
const LongInt LongInt::operator+ (const LongInt &r) const
 Addition operator.
const LongInt LongInt::operator++ (int)
 Increment operator.
const LongInt LongInt::operator++ ()
 Increment operator.
LongIntLongInt::operator+= (const signed long &r)
 Addition assignment operator.
LongIntLongInt::operator+= (const LongInt &r)
 Addition assignment operator.
const LongInt LongInt::operator- (const long &r) const
 Subtraction operator.
const LongInt LongInt::operator- (const LongInt &r) const
 Subtraction operator.
const LongInt LongInt::operator-- (int)
 Decrement operator.
const LongInt LongInt::operator-- ()
 Decrement operator.
LongIntLongInt::operator-= (const signed long &r)
 Subtraction assignment operator.
LongIntLongInt::operator-= (const LongInt &r)
 Subtraction assignment operator.
const LongInt LongInt::operator/ (const long &r) const
 Division operator.
const LongInt LongInt::operator/ (const LongInt &r) const
 Division operator.
LongIntLongInt::operator/= (const signed long &r)
 Division assignment operator.
LongIntLongInt::operator/= (const LongInt &r)
 Division assignment operator.
const bool LongInt::operator< (const long &r) const
 Less than operator.
const bool LongInt::operator< (const LongInt &r) const
 Less than operator.
const LongInt LongInt::operator<< (const signed long &r) const
 Left shift operator.
const bool LongInt::operator<= (const long &r) const
 Greater or equal operator.
const bool LongInt::operator<= (const LongInt &r) const
 Less than or equal operator.
LongIntLongInt::operator= (const signed long &r)
 Assignment operator.
LongIntLongInt::operator= (const LongInt &r)
 Assignment operator.
const bool LongInt::operator== (const long &r) const
 Equal operator.
const bool LongInt::operator== (const LongInt &r) const
 Equal operator.
const bool LongInt::operator> (const long &r) const
 Greater than operator.
const bool LongInt::operator> (const LongInt &r) const
 Greater than operator.
const bool LongInt::operator>= (const long &r) const
 Greater or equal operator.
const bool LongInt::operator>= (const LongInt &r) const
 Greater or equal operator.
LongInt LongInt::Pow (unsigned long exp) const
 Raises the LongInt to the x-th power.
LongInt LongInt::Pow (const LongInt &exp) const
 Raises the LongInt to the x-th power.
CASObjectLongInt::Power (const CASObject *exp) const
 Raises the LongInt to the x-th power.
void LongInt::Print () const
 Prints the LongInt to stdout.
void CASNumeric::SetSign (signedness s)
 Sets the sign explicitly.
void LongInt::setzero ()
 Sets the LongInt to zero.
void LongInt::str2longint (const char *str_num)
 Converts a C-string to a LongInt.
void LongInt::stripzeros ()
 Strips off unneeded zeros.
CASObjectLongInt::Subtract (const CASObject *sub) const
 Subtracts another CASObject from the LongInt.
 LongInt::~LongInt ()
 Destructor.

Detailed Description

Classes which represents numeric values.

Enumeration Type Documentation

enum signedness

Indicates the signedness of the numerical value.

Definition at line 57 of file casnumeric.h.


Function Documentation

CASObject * LongInt::Absolute (  )  const [virtual, inherited]

Returns the absolute value of the LongInt.

Remarks:
The LongInt returned has to be freed by the caller.
Returns:
a pointer to a CASObject representing the absolute value of the LongInt.

Implements CASObject.

Definition at line 491 of file longint.cc.

CASObject * LongInt::Add ( const CASObject addend  )  const [virtual, inherited]

Adds another CASObject to this LongInt. If the CASObject is of the type CT_LONGINT, the sum is a LongInt. Else it is of the type CT_SUM, hence a Sum object.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
addend Pointer to the CASObject which is added to the LongInt.
Returns:
if the addend is of type CT_LONGINT, a LongInt representing the sum, else it returns a pointer to a Sum object.

Implements CASObject.

Definition at line 723 of file longint.cc.

CASObject * LongInt::Clone (  )  const [virtual, inherited]

Clones the LongInt by creating a new copy on in the memory.

Remarks:
The LongInt returned has to be freed by the caller.
Returns:
a pointer to a CASObject representing the cloned LongInt.

Implements CASObject.

Definition at line 359 of file longint.cc.

CASObject * LongInt::Divide ( const CASObject divisor  )  const [virtual, inherited]

Divides this LongInt by another CASObject. The quotient is always expressed as a Fraction object.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
divisor Pointer to the CASObject which this LongInt is divided by.
Returns:
a pointer to a CASObject which is a Fraction.

Implements CASObject.

Definition at line 844 of file longint.cc.

CASObject * LongInt::Evaluate (  )  const [virtual, inherited]

Evaluates the LongInt, which is cloning it, and setting all necessary flags to true in CASMetaInfo. A LongInt basically cannot be evaluated.

Remarks:
The CASObject returned has to be freed by the caller.
Returns:
a pointer to a CASObject representing the evaluated form.

Implements CASObject.

Definition at line 1024 of file longint.cc.

LongInt LongInt::FractionalPart ( signed long  r  )  const [inherited]

Warning:
Not properly implemented.
Computes the fractional part of this LongInt and the signed long integer provided as argument. It depends on the value of div_depth to determine how many decimal places after the period it has to compute.

Parameters:
r Signed long integer which is the divisor.
Returns:
a LongInt indicating the fractional part of the division.

Definition at line 705 of file longint.cc.

LongInt LongInt::FractionalPart ( const LongInt r  )  const [inherited]

Todo:
Has to be Implemented properly.
Warning:
Not properly implemented.
Computes the fractional part of this LongInt and the one provided as argument. It depends on the value of div_depth to determine how many decimal places after the period it has to compute.

Parameters:
r Reference to a LongInt which is the divisor.
Returns:
a LongInt indicating the fractional part of the division.

Definition at line 610 of file longint.cc.

unsigned long LongInt::frontpartlength (  )  const [private, inherited]

Returns the lenght in string representation of the front group.

Definition at line 68 of file longint.cc.

CASObject * LongInt::GCD ( const CASObject i  )  const [virtual, inherited]

It computes the greatest common divisor of this LongInt and the CASObject passed as argument. If the argument is not a LongInt it returns a LongInt of the value one.

Remarks:
The LongInt returned has to be freed by the caller.
Parameters:
i Pointer to a CASObject.
Returns:
if i is of type CT_LONGINT, it returns the gcd as LongInt, else it returns one in any case.

Implements CASObject.

Definition at line 531 of file longint.cc.

void LongInt::Get ( std::string &  s  )  const [virtual, inherited]

Returns the string representation of the LongInt as std::string.

Parameters:
s Reference to a std::string.
Returns:
void.

Implements CASObject.

Definition at line 422 of file longint.cc.

void LongInt::Get ( char *  s,
unsigned long  size 
) const [virtual, inherited]

Returns the string representation of the LongInt in s. The buffer has to be large enough to hold the string representation, else a EBufToSmall exception is thrown.

Parameters:
s Pointer to the buffer receiving the string representation.
size Size of the buffer.
Returns:
void.

Implements CASObject.

Definition at line 409 of file longint.cc.

void LongInt::Get ( char **  s  )  const throw ( EInvArg, EUninitializedPtr ) [inherited]

Returns the string representation of the LongInt. The buffer is allocated by the method and large enough to hold the string representation of the LongInt. The argument s is expected to be initialized to NULL.

Remarks:
The buffer allocated by the method has to be freed by the caller.
Parameters:
s Pointer to char pointer which has to be initialized to NULL.
Returns:
a pointer to the string representation of the LongInt.

Definition at line 384 of file longint.cc.

signedness CASNumeric::GetSign (  )  const [inherited]

Returns the sign in terms of Negative or Positive as defined in signedness.

Returns:
signedness.

Definition at line 65 of file casnumeric.cc.

CASObject * LongInt::Invert (  )  const [virtual, inherited]

Inverts the sign of the LongInt.

Remarks:
The LongInt returned has to be freed by the caller.
Returns:
a pointer to a CASObject representing the inverted LongInt.

Implements CASObject.

Definition at line 475 of file longint.cc.

bool LongInt::IsEqual ( const CASObject o  )  const [virtual, inherited]

Indicates whether or not this LongInt is equal to another CASObject.

Parameters:
o Pointer to a CASObject which is tested for equality.
Returns:
true if the objects are equal, false otherwise.

Implements CASObject.

Definition at line 927 of file longint.cc.

bool LongInt::IsGT ( const CASObject o  )  const [virtual, inherited]

Indicates whether or not this LongInt is greater than another CASObject.

Parameters:
o Pointer to a CASObject which is compared.
Returns:
true if this object is greater than the other, false otherwise.

Implements CASObject.

Definition at line 982 of file longint.cc.

bool LongInt::IsLT ( const CASObject o  )  const [virtual, inherited]

Indicates whether or not this LongInt is less than another CASObject.

Parameters:
o Pointer to a CASObject which is compared.
Returns:
true if this object is less than the other, false otherwise.

Implements CASObject.

Definition at line 952 of file longint.cc.

bool LongInt::IsOne (  )  const [virtual, inherited]

Indicates whether or not the LongInt is one.

Returns:
true if it is one, false otherwise.

Implements CASObject.

Definition at line 514 of file longint.cc.

bool LongInt::IsSimilar ( const CASObject o  )  const [virtual, inherited]

Indicates whether or not this LongInt is similar to another CASObject. The test is done by comparing the type of the objects. They are assumed to be similar, if the have the same type, hence CT_LONGINT.

Parameters:
o Pointer to a CASObject which is tested for similarity.
Returns:
true if this object and the other are similar, false otherwise.

Implements CASObject.

Definition at line 1004 of file longint.cc.

bool LongInt::IsZero (  )  const [virtual, inherited]

Indicates whether or not the LongInt is zero.

Returns:
true if it is zero, false otherwise.

Implements CASObject.

Definition at line 504 of file longint.cc.

unsigned long LongInt::Length (  )  const [virtual, inherited]

Returns the length of the LongInt in terms of digits including the negative sign, if applicable.

Returns:
the length of the LongInt in terms of digits including the negative sign, if applicable.

Implements CASObject.

Definition at line 439 of file longint.cc.

LongInt::LongInt ( const LongInt r  )  [inherited]

Copy constructor.

Parameters:
r Reference to a LongInt.

Definition at line 318 of file longint.cc.

LongInt::LongInt ( const std::string &  s  )  [inherited]

Constructor. Initializes the LongInt to the number provided in the std::string.

Parameters:
s Reference to a std::string representing the number the LongInt has to be initialized to.

Definition at line 304 of file longint.cc.

LongInt::LongInt ( const char *  s  )  [inherited]

Constructor. Initializes the LongInt to the number provided in the C-string.

Parameters:
s C-String representing the number the LongInt has to be initialized to.

Definition at line 288 of file longint.cc.

LongInt::LongInt ( signed long  l = 0  )  [inherited]

Constructor. Initializes the LongInt to the provided signed long integer.

Parameters:
l Signed long integer to which the LongInt is initialized.

Definition at line 272 of file longint.cc.

void LongInt::longint2str ( char *  s,
unsigned long  size 
) const [private, inherited]

Converts the LongInt to a C-string.

Remarks:
The buffer provided has to be allocated by the caller and must be of appropriate size to hold the string representation of the LongInt. If the buffer is too small, a EBufTooSmall exception is thrown. Further, the buffer has to be freed by the caller.
Parameters:
s Pointer to the buffer holding the converted LongInt.
size Size of the buffer. It has to be of appropriate size to hold the string representation.
Returns:
void.

Definition at line 185 of file longint.cc.

CASObject * LongInt::Modulo ( const CASObject divisor  )  const [virtual, inherited]

Calculates the modulus of the LongInt and a CASObject. The modulus is always zero if the CASObject is not of type CT_LONGINT.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
divisor Pointer to a CASObject.
Returns:
the modulus as a pointer to a CASObject.

Implements CASObject.

Definition at line 901 of file longint.cc.

CASObject * LongInt::Multiply ( const CASObject fact  )  const [virtual, inherited]

Multiplies this LongInt by another CASObject. If the CASObject is of the type CT_LONGINT, the product is a LongInt. Else it is of the type CT_PRODUCT, hence a Product object.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
fact Pointer to the CASObject which this LongInt is multiplied by.
Returns:
if the fact is of type CT_LONGINT, a LongInt representing the product, else it returns a pointer to a Product object.

Implements CASObject.

Definition at line 802 of file longint.cc.

void LongInt::num2longint ( const signed long  num  )  [private, inherited]

Converts a signed long integer to a LongInt.

Parameters:
num The signed long integer to be converted.
Returns:
void.

Definition at line 152 of file longint.cc.

const LongInt LongInt::operator * ( const long &  r  )  const [inherited]

Multiplication operator. Multiplies the LongInt by a signed long integer.

Parameters:
r Reference to a signed long integer.
Returns:
LongInt.

Definition at line 1387 of file longint.cc.

const LongInt LongInt::operator * ( const LongInt r  )  const [inherited]

Multiplication operator. Multiplies two LongInt.

Parameters:
r Reference to a LongInt.
Returns:
LongInt.

Definition at line 1327 of file longint.cc.

LongInt & LongInt::operator *= ( const signed long &  r  )  [inherited]

Multiplication assignment operator.

Parameters:
r Reference to a signed long integer.
Returns:
reference to LongInt.

Definition at line 1175 of file longint.cc.

LongInt & LongInt::operator *= ( const LongInt r  )  [inherited]

Multiplication assignment operator.

Parameters:
r Reference to a LongInt.
Returns:
reference to LongInt.

Definition at line 1163 of file longint.cc.

const bool LongInt::operator!= ( const long &  r  )  const [inherited]

Not equal operator. Compares this LongInt with a signed long integer.

Parameters:
r Reference to a signed long integer.
Returns:
true if values are not equal, false otherwise.

Definition at line 1735 of file longint.cc.

const bool LongInt::operator!= ( const LongInt r  )  const [inherited]

Not equal operator. Compares this LongInt with another LongInt

Parameters:
r Reference to a LongInt.
Returns:
true if both LongInt are not equal, false otherwise.

Definition at line 1722 of file longint.cc.

const LongInt LongInt::operator% ( const long &  r  )  const [inherited]

Modulo operator. Computes the modulus of this LongInt divided by a signed long integer.

Parameters:
r Reference to a signed long integer.
Returns:
LongInt.

Definition at line 1658 of file longint.cc.

const LongInt LongInt::operator% ( const LongInt r  )  const [inherited]

Todo:
In some cases, it returns wrong values
Bug:
In some cases, it returns wrong values.
Modulo operator. Computes the modulus of this LongInt divided by another LongInt.

Parameters:
r Reference to a LongInt.
Returns:
LongInt.

Definition at line 1623 of file longint.cc.

LongInt & LongInt::operator%= ( const signed long &  r  )  [inherited]

Modulo assignment operator.

Parameters:
r Reference to a signed long integer.
Returns:
reference to LongInt.

Definition at line 1223 of file longint.cc.

LongInt & LongInt::operator%= ( const LongInt r  )  [inherited]

Modulo assignment operator.

Parameters:
r Reference to a LongInt.
Returns:
reference to LongInt.

Definition at line 1211 of file longint.cc.

const LongInt LongInt::operator+ ( const long &  r  )  const [inherited]

Addition operator. Adds a signed long integer to the LongInt.

Parameters:
r Reference to a signed long integer.
Returns:
LongInt.

Definition at line 1315 of file longint.cc.

const LongInt LongInt::operator+ ( const LongInt r  )  const [inherited]

Addition operator. Adds two LongInt.

Parameters:
r Reference to a LongInt.
Returns:
LongInt.

Definition at line 1235 of file longint.cc.

const LongInt LongInt::operator++ ( int   )  [inherited]

Prefix increment operator. Increments the LongInt by one.

Returns:
LongInt.

Definition at line 1978 of file longint.cc.

const LongInt LongInt::operator++ (  )  [inherited]

Postfix increment operator. Increments the LongInt by one.

Returns:
LongInt.

Definition at line 1968 of file longint.cc.

LongInt & LongInt::operator+= ( const signed long &  r  )  [inherited]

Addition assignment operator.

Parameters:
r Reference to a signed long integer.
Returns:
reference to LongInt.

Definition at line 1127 of file longint.cc.

LongInt & LongInt::operator+= ( const LongInt r  )  [inherited]

Addition assignment operator.

Parameters:
r Reference to a LongInt.
Returns:
reference to LongInt.

Definition at line 1115 of file longint.cc.

const LongInt LongInt::operator- ( const long &  r  )  const [inherited]

Subtraction operator. Subtracts a signed long integer from this LongInt

Parameters:
r Reference to a signed long integer.
Returns:
LongInt.

Definition at line 1495 of file longint.cc.

const LongInt LongInt::operator- ( const LongInt r  )  const [inherited]

Subtraction operator. Subtracts a LongInt from this LongInt

Parameters:
r Reference to a LongInt.
Returns:
LongInt.

Definition at line 1399 of file longint.cc.

const LongInt LongInt::operator-- ( int   )  [inherited]

Prefix decrement operator. Decrements the LongInt by one.

Returns:
LongInt.

Definition at line 2001 of file longint.cc.

const LongInt LongInt::operator-- (  )  [inherited]

Postfix decrement operator. Decrements the LongInt by one.

Returns:
LongInt.

Definition at line 1991 of file longint.cc.

LongInt & LongInt::operator-= ( const signed long &  r  )  [inherited]

Subtraction assignment operator.

Parameters:
r Reference to a signed long integer.
Returns:
reference to LongInt.

Definition at line 1151 of file longint.cc.

LongInt & LongInt::operator-= ( const LongInt r  )  [inherited]

Subtraction assignment operator.

Parameters:
r Reference to a LongInt.
Returns:
reference to LongInt.

Definition at line 1139 of file longint.cc.

const LongInt LongInt::operator/ ( const long &  r  )  const [inherited]

Division operator. Divides this LongInt by a signed long integer.

Parameters:
r Reference to a signed long integer.
Returns:
LongInt.

Definition at line 1606 of file longint.cc.

const LongInt LongInt::operator/ ( const LongInt r  )  const [inherited]

Division operator. Divides this LongInt by another LongInt.

Parameters:
r Reference to a LongInt.
Returns:
LongInt.

Definition at line 1507 of file longint.cc.

LongInt & LongInt::operator/= ( const signed long &  r  )  [inherited]

Division assignment operator.

Parameters:
r Reference to a signed long integer.
Returns:
reference to LongInt.

Definition at line 1199 of file longint.cc.

LongInt & LongInt::operator/= ( const LongInt r  )  [inherited]

Division assignment operator.

Parameters:
r Reference to a LongInt.
Returns:
reference to LongInt.

Definition at line 1187 of file longint.cc.

const bool LongInt::operator< ( const long &  r  )  const [inherited]

Less than operator. Compares this LongInt with a unsigned long integer.

Parameters:
r Reference to a LongInt.
Returns:
true if this LongInt is less than r, false otherwise.

Definition at line 1799 of file longint.cc.

const bool LongInt::operator< ( const LongInt r  )  const [inherited]

Less than operator. Compares this LongInt with another LongInt

Parameters:
r Reference to a LongInt.
Returns:
true if this LongInt is less than r, false otherwise.

Definition at line 1749 of file longint.cc.

const LongInt LongInt::operator<< ( const signed long &  r  )  const [inherited]

Left shift operator. Shifts the LongInt to the left by appending groups of zeros to the right.

Parameters:
r Reference to a signed long integer.
Returns:
LongInt.

Definition at line 1948 of file longint.cc.

const bool LongInt::operator<= ( const long &  r  )  const [inherited]

Less than or equal operator. Compares this LongInt with a unsigned long integer.

Parameters:
r Reference to a LongInt.
Returns:
true if this LongInt is less than or equal r, false otherwise.

Definition at line 1935 of file longint.cc.

const bool LongInt::operator<= ( const LongInt r  )  const [inherited]

Less than or equal operator. Compares this LongInt with another LongInt

Parameters:
r Reference to a LongInt.
Returns:
true if this LongInt is less than or equal r, false otherwise.

Definition at line 1913 of file longint.cc.

LongInt & LongInt::operator= ( const signed long &  r  )  [inherited]

Assignment operator.

Parameters:
r Reference to a signed long integer.
Returns:
reference to LongInt.

Definition at line 1087 of file longint.cc.

LongInt & LongInt::operator= ( const LongInt r  )  [inherited]

Assignment operator.

Parameters:
r Reference to a LongInt.
Returns:
reference to LongInt.

Definition at line 1046 of file longint.cc.

const bool LongInt::operator== ( const long &  r  )  const [inherited]

Equal operator. Compares this LongInt with a signed long integer.

Parameters:
r Reference to a signed long integer.
Returns:
true if values are equal, false otherwise.

Definition at line 1708 of file longint.cc.

const bool LongInt::operator== ( const LongInt r  )  const [inherited]

Equal operator. Compares this LongInt with another LongInt

Parameters:
r Reference to a LongInt.
Returns:
true if both LongInt are equal, false otherwise.

Definition at line 1671 of file longint.cc.

const bool LongInt::operator> ( const long &  r  )  const [inherited]

Greater than operator. Compares this LongInt with a unsigned long integer.

Parameters:
r Reference to a LongInt.
Returns:
true if this LongInt is greater than r, false otherwise.

Definition at line 1863 of file longint.cc.

const bool LongInt::operator> ( const LongInt r  )  const [inherited]

Greater than operator. Compares this LongInt with another LongInt

Parameters:
r Reference to a LongInt.
Returns:
true if this LongInt is greater than r, false otherwise.

Definition at line 1813 of file longint.cc.

const bool LongInt::operator>= ( const long &  r  )  const [inherited]

Greater than or equal operator. Compares this LongInt with a unsigned long integer.

Parameters:
r Reference to a LongInt.
Returns:
true if this LongInt is greater than or equal r, false otherwise.

Definition at line 1899 of file longint.cc.

const bool LongInt::operator>= ( const LongInt r  )  const [inherited]

Greater than or equal operator. Compares this LongInt with another LongInt

Parameters:
r Reference to a LongInt.
Returns:
true if this LongInt is greater than or equal r, false otherwise.

Definition at line 1877 of file longint.cc.

LongInt LongInt::Pow ( unsigned long  exp  )  const [inline, inherited]

Warning:
Very inefficient.
Raises the LongInt to the power given as argument.

Parameters:
exp unsigned long which is the power.
Returns:
a LongInt which is raised to the given power.

Definition at line 589 of file longint.cc.

LongInt LongInt::Pow ( const LongInt exp  )  const [inherited]

Todo:
Choose a more efficient implementation.
Warning:
Very inefficient.
Bug:
Cannot handle negative exponents.
Raises the LongInt to the power given as argument.

Parameters:
exp Reference to a LongInt which is the power.
Returns:
a LongInt which is raised to the given power.

Definition at line 569 of file longint.cc.

CASObject * LongInt::Power ( const CASObject exp  )  const [virtual, inherited]

Todo:
Has to be implemented properly. Chokes on non-integer exponents.
Warning:
Not properly implemented. Chokes on non-integer exponents.
Raises this LongInt to the power indicated by the argument.

Parameters:
exp Pointer to a CASObject indicating the power.
Returns:
pointer to CASObject representing the exponentiated LongInt.

Implements CASObject.

Definition at line 864 of file longint.cc.

void LongInt::Print (  )  const [virtual, inherited]

Prints the string representation of the LongInt to stdout.

Returns:
void.

Implements CASObject.

Definition at line 457 of file longint.cc.

void CASNumeric::SetSign ( signedness  s  )  [inherited]

Sets the sign explicitly to a value specified in signedness.

Parameters:
s The signedness to be set.
Returns:
void.

Definition at line 47 of file casnumeric.cc.

void LongInt::setzero (  )  [private, inherited]

Sets the LongInt to zero.

Returns:
void.

Definition at line 233 of file longint.cc.

void LongInt::str2longint ( const char *  str_num  )  [private, inherited]

Converts a C-string to a LongInt. strtol() is used to convert the digits. However, the method takes care of interpreting '+' and '-' in front of the number itself.

Parameters:
str_num Pointer to the C-String holding the number to be converted.
Returns:
void.

Definition at line 93 of file longint.cc.

void LongInt::stripzeros (  )  [private, inherited]

Removes zeros from the front of the LongInt.

Returns:
void.

Definition at line 245 of file longint.cc.

CASObject * LongInt::Subtract ( const CASObject sub  )  const [virtual, inherited]

Subtracts another CASObject from this LongInt. If the CASObject is of the type CT_LONGINT, the difference is a LongInt. Else it is of the type CT_SUM, hence a Sum object.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
sub Pointer to the CASObject which is subtracted from the LongInt.
Returns:
if the subtrahend is of type CT_LONGINT, a LongInt representing the difference, else it returns a pointer to a Sum object.

Implements CASObject.

Definition at line 761 of file longint.cc.

LongInt::~LongInt (  )  [inherited]

Destructor.

Definition at line 341 of file longint.cc.


Generated on Sun Dec 31 01:57:28 2006 for ECAS by  doxygen 1.4.7