Axiom.Media.Bitwise.FirstPO2From C# (CSharp) Method

FirstPO2From() public static method

Returns the closest power-of-two number greater or equal to value.
0 and 1 are powers of two, so firstPO2From(0)==0 and firstPO2From(1)==1.
public static FirstPO2From ( uint n ) : uint
n uint
return uint
		public static uint FirstPO2From( uint n )
		{
			--n;
			n |= n >> 16;
			n |= n >> 8;
			n |= n >> 4;
			n |= n >> 2;
			n |= n >> 1;
			++n;
			return n;
		}