Annchienta::MathManager Class Reference

List of all members.

Public Member Functions

float abs (const float &value) const
int abs (const int &value) const
 MathManager ()
int max (const int &a, const int &b) const
int min (const int &a, const int &b) const
int nearestPowerOfTwo (const int &input) const
void newRandomSeed () const
float randFloat (const float &minimum, const float &maximum) const
float randFloat () const
int randInt (const int &minimum, const int &maximum) const
int randInt (const int &maximum) const
 ~MathManager ()


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:
value An integer.
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.


Generated on Wed Feb 4 16:31:47 2009 for Annchienta by  doxygen 1.5.7.1