math3d.h
inline unsigned int m3dIsPOW2(unsigned int iValue)
    {
    unsigned int nPow2 = 1;
    
    while(iValue > nPow2)
        nPow2 = (nPow2 << 1);
    
    return nPow2;
    }
// Returns the same number if it is a power of
// two. Returns a larger integer if it is not a 
// power of two. The larger integer is the next
// highest power of two.

Returns the same number if it is a power of
two. Returns a larger integer if it is not a
power of two. The larger integer is the next
highest power of two.
Returns the same number if it is a power of two . Returns a larger integer if it is not a power of two . The larger integer is the next highest power of two .
inline unsigned int m3dIsPOW2(unsigned int iValue)
    {
    unsigned int nPow2 = 1;
    while(iValue > nPow2)
        nPow2 = (nPow2 << 1);
    return nPow2;
    }
inline unsigned int m3dIsPOW2 ( unsigned int iValue ) { unsigned int nPow2 = 1 ; while ( iValue > nPow2 ) nPow2 = ( nPow2 << 1 ) ; return nPow2 ; }
Returns the same number if it is a power of
two.
Returns the same number if it is a power of two .