C# Get Binary Length

  • 85
  • 0

C# Get Binary Length

 

 

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