Main Page Modules Namespaces C++ Classes Compound List File List Index
TNL: Many version of min and max

# Many version of min and max

## Detailed Description

We can't use template functions because MSVC6 chokes.

So we have these...

## GeneralMath Math Helpers

Some general numeric utility functions.
bool | TNL::isPow2 (const U32 number)
| Determines if number is a power of two.
U32 | TNL::getBinLog2 (U32 value)
| Determines the binary logarithm of the input value rounded down to the nearest power of 2.
U32 | TNL::getNextBinLog2 (U32 number)
| Determines the binary logarithm of the next greater power of two of the input number.
U32 | TNL::getNextPow2 (U32 value)
| Determines the next greater power of two from the value. If the value is a power of two, it is returned.
#define | DeclareTemplatizedMinMax(type)

## Functions

| TNL::Int::Int (U32 val=0)
| TNL::Int::operator U32 () const
U32 | TNL::Int::getPrecisionBits ()
| TNL::SignedInt::SignedInt (S32 val=0)
| TNL::SignedInt::operator S32 () const
U32 | TNL::SignedInt::getPrecisionBits ()
| TNL::Float::Float (F32 val=0)
| TNL::Float::operator F32 () const
U32 | TNL::Float::getPrecisionBits ()
| TNL::SignedFloat::SignedFloat (F32 val=0)
| TNL::SignedFloat::operator F32 () const
U32 | TNL::SignedFloat::getPrecisionBits ()
| TNL::RangedU32::RangedU32 (U32 val=rangeStart)
| TNL::RangedU32::operator U32 () const
| TNL::DeclareTemplatizedMinMax (U32) DeclareTemplatizedMinMax(S32) DeclareTemplatizedMinMax(U16) DeclareTemplatizedMinMax(S16) DeclareTemplatizedMinMax(U8) DeclareTemplatizedMinMax(S8) DeclareTemplatizedMinMax(F32) DeclareTemplatizedMinMax(F64) inline void writeU32ToBuffer(U32 value

## Define Documentation

#define DeclareTemplatizedMinMax | ( | type |  | ) |

Value:

    inline type getMin(type a, type b) { return a > b ? b : a; } \
     inline type getMax(type a, type b) { return a > b ? a : b; }

## Function Documentation

template<U32 bitCount>

TNL::Int< bitCount >::Int | ( | U32 | val = `0` | ) | `[inline, inherited]`

template<U32 bitCount>

TNL::Int< bitCount >::operator U32 | ( |  | ) | const`[inline, inherited]`

template<U32 bitCount>

U32 TNL::Int< bitCount >::getPrecisionBits | ( |  | ) | `[inline, inherited]`

template<U32 bitCount>

TNL::SignedInt< bitCount >::SignedInt | ( | S32 | val = `0` | ) | `[inline, inherited]`

template<U32 bitCount>

TNL::SignedInt< bitCount >::operator S32 | ( |  | ) | const`[inline, inherited]`

template<U32 bitCount>

U32 TNL::SignedInt< bitCount >::getPrecisionBits | ( |  | ) | `[inline, inherited]`

template<U32 bitCount>

TNL::Float< bitCount >::Float | ( | F32 | val = `0` | ) | `[inline, inherited]`

template<U32 bitCount>

TNL::Float< bitCount >::operator F32 | ( |  | ) | const`[inline, inherited]`

template<U32 bitCount>

U32 TNL::Float< bitCount >::getPrecisionBits | ( |  | ) | `[inline, inherited]`

template<U32 bitCount>

TNL::SignedFloat< bitCount >::SignedFloat | ( | F32 | val = `0` | ) | `[inline, inherited]`

template<U32 bitCount>

TNL::SignedFloat< bitCount >::operator F32 | ( |  | ) | const`[inline, inherited]`

template<U32 bitCount>

U32 TNL::SignedFloat< bitCount >::getPrecisionBits | ( |  | ) | `[inline, inherited]`

template<U32 rangeStart, U32 rangeEnd>

TNL::RangedU32< rangeStart, rangeEnd >::RangedU32 | ( | U32 | val = `rangeStart` | ) | `[inline, inherited]`

template<U32 rangeStart, U32 rangeEnd>

TNL::RangedU32< rangeStart, rangeEnd >::operator U32 | ( |  | ) | const`[inline, inherited]`

TNL::DeclareTemplatizedMinMax | ( | U32 |  | ) |

bool TNL::isPow2 | ( | const U32 | number | ) | `[inline]`

Determines if number is a power of two.

U32 TNL::getBinLog2 | ( | U32 | value | ) | `[inline]`

Determines the binary logarithm of the input value rounded down to the nearest power of 2.

U32 TNL::getNextBinLog2 | ( | U32 | number | ) | `[inline]`

Determines the binary logarithm of the next greater power of two of the input number.

U32 TNL::getNextPow2 | ( | U32 | value | ) | `[inline]`

Determines the next greater power of two from the value. If the value is a power of two, it is returned.