zeus::TInt Class Reference
#include <Int.h>
List of all members.
Detailed Description
This class implements a wrapper for int-values
Constructor & Destructor Documentation
Creates an empty Int-Object
| TInt::TInt |
( |
Int |
iValue |
) |
|
Creates a Int-Object
- Parameters:
-
| TInt::TInt |
( |
const TInt & |
rIn |
) |
|
| TInt::~TInt |
( |
|
) |
[virtual] |
Member Function Documentation
| void zeus::TInt::factorize |
( |
IMap< Int, Int > & |
rFactors |
) |
const [inline] |
factorizes the number and returns a map containing the factor (key) and its potential (value).
| TString TInt::format |
( |
Uint |
uiLeadingZeros |
) |
const |
This converts the int value into a string
- Parameters:
-
| uiLeadingZeros | : How many leading zeros the formated output must have |
- Returns:
- return of the formated output
| Int zeus::TInt::getDigitCount |
( |
Uint |
uiNumBase = 10 |
) |
const [inline] |
Returns the number of digits representing this number.
| Int64 zeus::TInt::getFactorial |
( |
|
) |
const [inline] |
Returns the factorial of a number such as 7! = 1*2*3 ..*7
| bool zeus::TInt::isPrime |
( |
|
) |
const [inline] |
Checks if a number is prime
| TString zeus::TInt::toBinary |
( |
bool |
bTrimZeros = false |
) |
const [inline] |
This converts the int-value into the binary notation.
- Parameters:
-
| bTrimZeros | : if this flag is set it will trim all leading zeros 0x000011010 -> 0x11010 |
| TString zeus::TInt::toHex |
( |
bool |
bTrimZeros = false |
) |
const [inline] |
This converts the int-value into the hex notation.
- Parameters:
-
| bTrimZeros | : if this flag is set it will trim all leading zeros 0x0000FFA2 -> 0xFFA2 |
| void TInt::factorize |
( |
Int |
iValue, |
|
|
IMap< Int, Int > & |
rFactors | |
|
) |
| | [static] |
factorizes the number and returns a map containing the factor (key) and its potential (value).
- Parameters:
-
| iValue | : Number to factorize |
| rFactors | : return value. Map contains the factors (key) and the potentials (value of map) |
| Int TInt::getDigitCount |
( |
Int |
iValue, |
|
|
Uint |
uiNumBase | |
|
) |
| | [static] |
returns the number of digits to show the number in a specific base of numbers (such as decimal, binary etc.). Note that this method will not return any digit (space) used for signs. This method returns the digits in a mathematical way (not space needed).
- Parameters:
-
| iValue | : Number to check |
| iNumBase | : Base of number system |
- Returns:
- number of digits
| Int64 TInt::getFactorial |
( |
Int |
iVal |
) |
[static] |
Returns the factorial of a number. Note that this function can only handle n up to 20
- Parameters:
-
- Returns:
- n!
| bool TInt::isPrime |
( |
Int |
iValue |
) |
[static] |
checks if a number is prime
- Parameters:
-
| iValue | : Number to check. Note that all negative value are rejected by this method. If iValue equals 0 or 1 the method will return false. |
- Return values:
-
| true | : Number is prime |
| false,: | Number is not prime |
| Int TInt::log2 |
( |
Int |
iValue |
) |
[static] |
A fast way to get the logarithm to the base of 2
| Int zeus::TInt::randomInt |
( |
Int |
iFrom, |
|
|
Int |
iTo | |
|
) |
| | [inline, static] |
Returns a random integer number, which is between iFrom and iTo
- Parameters:
-
| iFrom | : lower limit |
| iTo | :upper limit |
- Returns:
- random number
| Int8 zeus::TInt::randomInt8 |
( |
|
) |
[inline, static] |
returns a random number of int8 values
| Int8 zeus::TInt::randomInt8 |
( |
Int8 |
cFrom, |
|
|
Int8 |
cTo | |
|
) |
| | [inline, static] |
returns a random number of int8 values
- Parameters:
-
| cFrom | : lower limit |
| cTo | : upper limit |
| Int16 zeus::TInt::randomInt16 |
( |
|
) |
[inline, static] |
returns a random number of int16 values
returns a random number of int16 values
- Parameters:
-
| sFrom | : lower limit |
| sTo | : upper limit |
| Int32 zeus::TInt::randomInt32 |
( |
|
) |
[inline, static] |
returns a random number of int32 values
returns a random number of int32 values
- Parameters:
-
| lFrom | : lower limit |
| lTo | : upper limit |
| Int64 zeus::TInt::randomInt64 |
( |
|
) |
[inline, static] |
returns a random number of int64 values
| Int64 zeus::TInt::randomInt64 |
( |
const Int64 & |
rldFrom, |
|
|
const Int64 & |
rldTo | |
|
) |
| | [inline, static] |
Returns a random 64 bit integer number, which is between ldFrom and ldTo
- Parameters:
-
| ldFrom | : lower limit |
| ldTo | :upper limit |
- Returns:
- random number
Member Data Documentation
The documentation for this class was generated from the following files: