Box2D.Common.MathUtils.CeilPowerOf2 C# (CSharp) Метод

CeilPowerOf2() публичный статический Метод

Rounds up the value to the nearest higher power^2 value.
public static CeilPowerOf2 ( int x ) : int
x int
Результат int
        public static int CeilPowerOf2(int x)
        {
            int pow2 = 1;
            while (pow2 < x)
            {
                pow2 <<= 1;
            }
            return pow2;
        }