Annchienta::MathManager Class Reference
List of all members.
Detailed Description
A class which can be used to solve mathematical problems. It is mainly used for generating random numbers.
Constructor & Destructor Documentation
Annchienta::MathManager::MathManager |
( |
|
) |
|
Annchienta::MathManager::~MathManager |
( |
|
) |
|
Member Function Documentation
float Annchienta::MathManager::abs |
( |
const float & |
value |
) |
const |
Returns the absolute value.
- Parameters:
-
| value | A floating point number. |
- Returns:
- The absolute value of the input.
int Annchienta::MathManager::abs |
( |
const int & |
value |
) |
const |
Returns the absolute value.
- Parameters:
-
- Returns:
- The absolute value of the input.
int Annchienta::MathManager::max |
( |
const int & |
a, |
|
|
const int & |
b | |
|
) |
| | const |
Returns a or b, whichever is the largest.
- Parameters:
-
| a | An integer. |
| b | An integer. |
- Returns:
- The largest of a and b.
int Annchienta::MathManager::min |
( |
const int & |
a, |
|
|
const int & |
b | |
|
) |
| | const |
Returns a or b, whichever is the smallest.
- Parameters:
-
| a | An integer. |
| b | An integer. |
- Returns:
- The smallest of a and b.
int Annchienta::MathManager::nearestPowerOfTwo |
( |
const int & |
input |
) |
const |
Returns the next power of two.
- Parameters:
-
| input | Any positive integer. |
- Returns:
- A power of two, larger than input.
void Annchienta::MathManager::newRandomSeed |
( |
|
) |
const |
Creates a new random seed.
float Annchienta::MathManager::randFloat |
( |
const float & |
minimum, |
|
|
const float & |
maximum | |
|
) |
| | const |
Get a random floating point number.
- Parameters:
-
| minimum | The minimum, inclusive. |
| maximum | The maximum, inclusice. |
- Returns:
- A floating point number.
float Annchienta::MathManager::randFloat |
( |
|
) |
const |
Get a random floating point number between 0 and 1, both inclusive.
- Returns:
- A floating point number.
int Annchienta::MathManager::randInt |
( |
const int & |
minimum, |
|
|
const int & |
maximum | |
|
) |
| | const |
Get a random integer.
- Parameters:
-
| minimum | The minimum, inclusive. |
| maximum | The maximum, exclusive. |
- Returns:
- The random integer.
int Annchienta::MathManager::randInt |
( |
const int & |
maximum |
) |
const |
Get a random integer.
- Parameters:
-
| maximum | The maximum, exclusive. |
- Returns:
- The random integer.