For a given number n, is there a way to determine in general the number of powers of two which are less/equal to n?

I should add that I mean integers.

For example, there are five powers of two less than/equal to 31: 1, 2, 4, 8, 16.

There are two less than/equal to 2: 1, 2

etc.