System.Numerics.BitOperations static class BitOperations Documentation Code public static int Log2(uint value)