```
int log2(int n)
{
int count = 1;
while(!n >= 1)
{
if (n%2 == 0)
{
count++;
n=n/2;
}
else
{
count++;
n=n/2;
floor(n);
}
}
return count;
}
```

not sure why it isnt working?