C# Get Binary Length

  • 69
  • 0

C# Get Binary Length

 

 

public static int GetBinaryLength(int n)
{
	return (int)Math.Log(n, 2) + 1;
}