#include <Math.hpp>
List of all members.
Static Public Member Functions |
| static Float | ceil (const Float &rfValue) |
| static Int | ceilInt (const Float &rfValue) |
| static Float | exp (const Float &rfX) |
| static Int | expInt (const Float &rfX) |
| static Float | floor (const Float &rfValue) |
| static Int | floorInt (const Float &rfValue) |
| static Float | ln (const Float &rfValue) |
| static Int | lnInt (const Float &rfValue) |
| static Float | log (const Float &rfValue, const Float &rfBase) |
| static Int | logInt (const Float &rfValue, const Float &rfBase) |
| static Float | maxFloat (Float fD1, Float fD2) |
| static Float | minFloat (Float fD1, Float fD2) |
| static Int | maxInt (Int iD1, Int iD2) |
| static Int | minInt (Int iD1, Int iD2) |
| static Float | pow (const Float &rfBase, const Float &rfExp) |
| static Int | powInt (const Float &rfBase, const Float &rfExp) |
| static Float | roundEx (Float fValue, Float fPrecision) |
| static Float | round (const Float &rfValue) |
| static Int | roundInt (const Float &rfValue) |
| static Float | sqrt (const Float &rfValue) |
| static Int | sqrtInt (const Float &rfValue) |
| static Int | gcd (Int iA, Int iB) |
| static Int | gcd (Int iA, Int iB, Int &rX, Int &rY) |
Protected Member Functions |
| | TMath () |
| virtual | ~TMath () |
Detailed Description
This class contains generous mathematical functions. To use float implementation you should use TFloat class which handles the NaN.
Constructor & Destructor Documentation
| zeus::TMath::TMath |
( |
) |
[inline, protected] |
| virtual zeus::TMath::~TMath |
( |
) |
[inline, protected, virtual] |
Member Function Documentation
| static Float zeus::TMath::ceil |
( |
const Float & |
rfValue ) |
[inline, static] |
| static Int zeus::TMath::ceilInt |
( |
const Float & |
rfValue ) |
[inline, static] |
| static Float zeus::TMath::exp |
( |
const Float & |
rfX ) |
[inline, static] |
| static Int zeus::TMath::expInt |
( |
const Float & |
rfX ) |
[inline, static] |
returns the e^x as an integer
| static Float zeus::TMath::floor |
( |
const Float & |
rfValue ) |
[inline, static] |
| static Int zeus::TMath::floorInt |
( |
const Float & |
rfValue ) |
[inline, static] |
| static Int zeus::TMath::gcd |
( |
Int |
iA, |
|
|
Int |
iB, |
|
|
Int & |
rX, |
|
|
Int & |
rY |
|
) |
| [inline, static] |
Returns the greatest common divisor of two numbers. This method implements the extended version, which also returns the X and Y components, such that ax + by = gcd(a,b). The algorithm has been taken from http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm
- Parameters:
-
| iA | : Number A |
| iB | : Number B |
| rX | : Return parameter of X component |
| rY | : Return parameter of Y component |
- Returns:
- greatest common divisor
| static Int zeus::TMath::gcd |
( |
Int |
iA, |
|
|
Int |
iB |
|
) |
| [inline, static] |
| static Float zeus::TMath::ln |
( |
const Float & |
rfValue ) |
[inline, static] |
Returns the logarithm naturalis of rfValue
| static Int zeus::TMath::lnInt |
( |
const Float & |
rfValue ) |
[inline, static] |
Returns the logarithm naturalis of rfValue as an integer
| static Float zeus::TMath::log |
( |
const Float & |
rfValue, |
|
|
const Float & |
rfBase |
|
) |
| [inline, static] |
| static Int zeus::TMath::logInt |
( |
const Float & |
rfValue, |
|
|
const Float & |
rfBase |
|
) |
| [inline, static] |
| static Float zeus::TMath::maxFloat |
( |
Float |
fD1, |
|
|
Float |
fD2 |
|
) |
| [inline, static] |
Gets the maximum of two float values
- Parameters:
-
| fD1 | : value 1 |
| fD2 | : value 2 |
- Returns:
- max(value 1, value 2)
| static Int zeus::TMath::maxInt |
( |
Int |
iD1, |
|
|
Int |
iD2 |
|
) |
| [inline, static] |
Gets the maximum of two int values
- Parameters:
-
| iD1 | : value 1 |
| iD2 | : value 2 |
- Returns:
- max(value 1, value 2)
| static Float zeus::TMath::minFloat |
( |
Float |
fD1, |
|
|
Float |
fD2 |
|
) |
| [inline, static] |
Gets the minimum of two float values
- Parameters:
-
| fD1 | : value 1 |
| fD2 | : value 2 |
- Returns:
- min(value 1, value 2)
| static Int zeus::TMath::minInt |
( |
Int |
iD1, |
|
|
Int |
iD2 |
|
) |
| [inline, static] |
Gets the minimum of two int values
- Parameters:
-
| iD1 | : value 1 |
| iD2 | : value 2 |
- Returns:
- min(value 1, value 2)
| static Float zeus::TMath::pow |
( |
const Float & |
rfBase, |
|
|
const Float & |
rfExp |
|
) |
| [inline, static] |
calculates the power of base by exponent
- Parameters:
-
| rfBase | : Base |
| rfExp | : Exponent |
- Returns:
- rfBase ^ rfExp
| static Int zeus::TMath::powInt |
( |
const Float & |
rfBase, |
|
|
const Float & |
rfExp |
|
) |
| [inline, static] |
calculates the power of base by exponent
- Parameters:
-
| rfBase | : Base |
| rfExp | : Exponent |
- Returns:
- rfBase ^ rfExp
| static Float zeus::TMath::round |
( |
const Float & |
rfValue ) |
[inline, static] |
rounds a double value to a integer number
- Parameters:
-
- Returns:
- round(rfValue)
| static Float zeus::TMath::roundEx |
( |
Float |
fValue, |
|
|
Float |
fPrecision |
|
) |
| [inline, static] |
rounds a float value to an other float value
- Parameters:
-
| fValue | : value to round |
| fPrecision | : default is 1.0. Using 0.1 it will round to tenth |
- Returns:
- round(dValue)
| static Int zeus::TMath::roundInt |
( |
const Float & |
rfValue ) |
[inline, static] |
rounds a double value to a integer
- Parameters:
-
- Returns:
- round(rfValue)
| static Float zeus::TMath::sqrt |
( |
const Float & |
rfValue ) |
[inline, static] |
returns the square root of a value
| static Int zeus::TMath::sqrtInt |
( |
const Float & |
rfValue ) |
[inline, static] |
returns the square root of a value as an integer
The documentation for this class was generated from the following file: