#include <LongInt.h>
Public Types | |
| enum | |
| typedef unsigned short | block_type |
| typedef unsigned long | double_block |
| typedef LongInt< BITS, MAY_OVERFLOW > | long_type |
Public Member Functions | |
| LongInt () | |
| LongInt (const LongInt &other) | |
| long_type & | operator= (const LongInt &other) |
| LongInt (int u) | |
| LongInt (double_block u) | |
| LongInt (const char *psz, unsigned int nBase=10) | |
| long_type & | complement2 () |
| long_type | operator- () const |
| long_type & | operator+= (const long_type &v) |
| long_type | operator+ (const long_type &v) const |
| long_type & | operator-= (const long_type &v) |
| long_type | operator- (const long_type &v) const |
| bool | isNegative () const |
| long_type & | operator *= (long_type v) |
| long_type | operator * (const long_type &v) |
| long_type & | operator/= (const long_type &d) |
| long_type | operator/ (const long_type &d) const |
| long_type & | operator%= (const long_type &d) |
| long_type | operator% (const long_type &d) const |
| long_type | divide (long_type v, long_type *pRem=0, bool bSigned=true) const |
| bool | operator! () const |
| int | compare (const long_type &v) const |
| bool | operator< (const long_type &v) const |
| bool | operator<= (const long_type &v) const |
| bool | operator== (const long_type &v) const |
| bool | operator!= (const long_type &v) const |
| std::string | toString (unsigned int nBase=10) const |
| void | display (std::ostream &os=std::cout) const |
| void | load (std::istream &is) |
| void | save (std::ostream &os) const |
| long_type & | fromString (const char *psz, unsigned int nBase=10) |
| long_type | operator<< (int n) const |
| long_type & | operator<<= (int u) |
| long_type | operator>> (int n) const |
| LongInt & | operator>>= (int u) |
| long_type | operator & (const long_type &v) const |
| long_type & | operator &= (const long_type &u) |
| long_type | operator| (const long_type &v) const |
| long_type & | operator|= (const long_type &u) |
| long_type | operator^ (const long_type &v) const |
| long_type & | operator^= (const long_type &u) |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const long_type &x) |
| std::istream & | operator>> (std::istream &is, long_type &x) |
Definition at line 39 of file LongInt.h.
| LongInt< BITS, MAY_OVERFLOW >::LongInt | ( | const LongInt< BITS, MAY_OVERFLOW > & | other | ) | [inline] |
Copy constructor
Definition at line 65 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::m_data.
| LongInt< BITS, MAY_OVERFLOW >::LongInt | ( | const char * | psz, | |
| unsigned int | nBase = 10 | |||
| ) | [inline, explicit] |
Constructor
Definition at line 114 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::fromString().
Here is the call graph for this function:

| long_type& LongInt< BITS, MAY_OVERFLOW >::operator= | ( | const LongInt< BITS, MAY_OVERFLOW > & | other | ) | [inline] |
Assignment operator
Definition at line 74 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::m_data.
| long_type& LongInt< BITS, MAY_OVERFLOW >::complement2 | ( | ) | [inline] |
Unary minus or two's complement
Definition at line 123 of file LongInt.h.
Referenced by LongInt< BITS, MAY_OVERFLOW >::divide(), LongInt< BITS, MAY_OVERFLOW >::fromString(), and LongInt< BITS, MAY_OVERFLOW >::operator *=().
Here is the caller graph for this function:

| long_type& LongInt< BITS, MAY_OVERFLOW >::operator+= | ( | const long_type & | v | ) | [inline] |
Addition assignment operator
Definition at line 162 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::m_data.
| long_type& LongInt< BITS, MAY_OVERFLOW >::operator-= | ( | const long_type & | v | ) | [inline] |
Subtraction assignment operator
Definition at line 221 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::m_data.
| bool LongInt< BITS, MAY_OVERFLOW >::isNegative | ( | ) | const [inline] |
Determine if this LongInt is negative
Definition at line 280 of file LongInt.h.
Referenced by LongInt< BITS, MAY_OVERFLOW >::compare(), LongInt< BITS, MAY_OVERFLOW >::divide(), LongInt< BITS, MAY_OVERFLOW >::operator *=(), LongInt< BITS, MAY_OVERFLOW >::operator>>(), and LongInt< BITS, MAY_OVERFLOW >::toString().
Here is the caller graph for this function:

| long_type& LongInt< BITS, MAY_OVERFLOW >::operator *= | ( | long_type | v | ) | [inline] |
Multiplication assignment operator
Definition at line 292 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::complement2(), LongInt< BITS, MAY_OVERFLOW >::isNegative(), and LongInt< BITS, MAY_OVERFLOW >::m_data.
Here is the call graph for this function:

| long_type& LongInt< BITS, MAY_OVERFLOW >::operator/= | ( | const long_type & | d | ) | [inline] |
Division assignment operator
| d | the dividend |
Definition at line 408 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::divide().
Here is the call graph for this function:

| long_type LongInt< BITS, MAY_OVERFLOW >::operator/ | ( | const long_type & | d | ) | const [inline] |
Division operator
| d | the dividend |
Definition at line 420 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::divide().
Here is the call graph for this function:

| long_type& LongInt< BITS, MAY_OVERFLOW >::operator%= | ( | const long_type & | d | ) | [inline] |
Modulo assignment operator
| d | the dividend |
Definition at line 431 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::divide().
Here is the call graph for this function:

| long_type LongInt< BITS, MAY_OVERFLOW >::operator% | ( | const long_type & | d | ) | const [inline] |
Modulo operator
| d | the dividend |
Definition at line 443 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::divide().
Here is the call graph for this function:

| long_type LongInt< BITS, MAY_OVERFLOW >::divide | ( | long_type | v, | |
| long_type * | pRem = 0, |
|||
| bool | bSigned = true | |||
| ) | const [inline] |
Compute the quotient and remainder of (this / v)
| v | The divisor | |
| [out] | pRem | If not null, this parameter will contain the remainder |
| bSigned | This should be always be true since LongInts are signed by default, if this parameter is false the LongInts are considered unsigned |
Definition at line 461 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::compare(), LongInt< BITS, MAY_OVERFLOW >::complement2(), LongInt< BITS, MAY_OVERFLOW >::isNegative(), and LongInt< BITS, MAY_OVERFLOW >::m_data.
Referenced by LongInt< BITS, MAY_OVERFLOW >::operator%(), LongInt< BITS, MAY_OVERFLOW >::operator%=(), LongInt< BITS, MAY_OVERFLOW >::operator/(), LongInt< BITS, MAY_OVERFLOW >::operator/=(), and LongInt< BITS, MAY_OVERFLOW >::toString().
Here is the call graph for this function:

Here is the caller graph for this function:

| bool LongInt< BITS, MAY_OVERFLOW >::operator! | ( | ) | const [inline] |
| int LongInt< BITS, MAY_OVERFLOW >::compare | ( | const long_type & | v | ) | const [inline] |
Compare two LongInt-s
| v | The second operand |
Definition at line 825 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::isNegative(), and LongInt< BITS, MAY_OVERFLOW >::m_data.
Referenced by LongInt< BITS, MAY_OVERFLOW >::divide(), AlgebraicTraits< LongInt< BITS, MAY_OVERFLOW > >::equals(), LongInt< BITS, MAY_OVERFLOW >::operator!=(), LongInt< BITS, MAY_OVERFLOW >::operator<(), LongInt< BITS, MAY_OVERFLOW >::operator<=(), and LongInt< BITS, MAY_OVERFLOW >::operator==().
Here is the call graph for this function:

Here is the caller graph for this function:

| bool LongInt< BITS, MAY_OVERFLOW >::operator< | ( | const long_type & | v | ) | const [inline] |
Less than operator
| v | Right hand side operand |
Definition at line 855 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::compare().
Here is the call graph for this function:

| bool LongInt< BITS, MAY_OVERFLOW >::operator<= | ( | const long_type & | v | ) | const [inline] |
Less than or equal operator
| v | Right hand side operand |
Definition at line 864 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::compare().
Here is the call graph for this function:

| bool LongInt< BITS, MAY_OVERFLOW >::operator== | ( | const long_type & | v | ) | const [inline] |
Equality operator
| v | Right hand side operand |
Definition at line 873 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::compare().
Here is the call graph for this function:

| bool LongInt< BITS, MAY_OVERFLOW >::operator!= | ( | const long_type & | v | ) | const [inline] |
Inequality operator
| v | Right hand side operand |
Definition at line 882 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::compare().
Here is the call graph for this function:

| std::string LongInt< BITS, MAY_OVERFLOW >::toString | ( | unsigned int | nBase = 10 |
) | const [inline] |
Convert to string
| nBase | The base to convert to, this can be between 2 and 36 inclusive |
Definition at line 892 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::divide(), LongInt< BITS, MAY_OVERFLOW >::isNegative(), and LongInt< BITS, MAY_OVERFLOW >::toLong().
Referenced by LongInt< BITS, MAY_OVERFLOW >::display().
Here is the call graph for this function:

Here is the caller graph for this function:

| void LongInt< BITS, MAY_OVERFLOW >::display | ( | std::ostream & | os = std::cout |
) | const [inline] |
Display this number to a stream
Definition at line 998 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::toString().
Here is the call graph for this function:

| void LongInt< BITS, MAY_OVERFLOW >::load | ( | std::istream & | is | ) | [inline] |
| void LongInt< BITS, MAY_OVERFLOW >::save | ( | std::ostream & | os | ) | const [inline] |
| long_type& LongInt< BITS, MAY_OVERFLOW >::fromString | ( | const char * | psz, | |
| unsigned int | nBase = 10 | |||
| ) | [inline] |
Initializes this LongInt from a string number representation
Definition at line 1029 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::complement2(), and math_exception::what().
Referenced by LongInt< BITS, MAY_OVERFLOW >::LongInt().
Here is the call graph for this function:

Here is the caller graph for this function:

| long_type LongInt< BITS, MAY_OVERFLOW >::operator<< | ( | int | n | ) | const [inline] |
Left shift operator
| n | The number of bits to shift to the left |
Definition at line 1113 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::m_data.
| long_type LongInt< BITS, MAY_OVERFLOW >::operator>> | ( | int | n | ) | const [inline] |
Right shift operator
| n | The number of bits to shift to the right |
Definition at line 1187 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::isNegative(), and LongInt< BITS, MAY_OVERFLOW >::m_data.
Here is the call graph for this function:

| long_type LongInt< BITS, MAY_OVERFLOW >::operator & | ( | const long_type & | v | ) | const [inline] |
Binary And operator
| v | Right hand side operand |
Definition at line 1246 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::m_data.
| long_type LongInt< BITS, MAY_OVERFLOW >::operator| | ( | const long_type & | v | ) | const [inline] |
Binary Or operator
| v | Right hand side operand |
Definition at line 1269 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::m_data.
| long_type LongInt< BITS, MAY_OVERFLOW >::operator^ | ( | const long_type & | v | ) | const [inline] |
Binary Xor operator
| v | Right hand side operand |
Definition at line 1293 of file LongInt.h.
References LongInt< BITS, MAY_OVERFLOW >::m_data.