/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: sgx/include/sgx/core/math/bitmath.hpp

*/

#ifndef SGX_CORE_MATH_BITMATH_HPP
#define SGX_CORE_MATH_BITMATH_HPP	1


/**
RoRN = Roll to the Right, using the least significant Nibble
*/
SGX_INLINE tBYTE sgxRoRN(const tBYTE v) {
	return (tBYTE)(((v>>1) | ((v&1)<<3)) & 0xf);
}

/**
RoRN = Roll to the left, using the least significant Nibble
*/
SGX_INLINE tBYTE sgxRoLN(const tBYTE v) {
	return (tBYTE)(((v<<1) | ((v&8)>>3)) & 0xf);
}


#endif /* SGX_CORE_MATH_BITMATH_HPP */
