Say I have a loop that runs, and after k iterations we find that it stops when:
$\left \lfloor{\frac{n}{2^k}}\right \rfloor <1$
We solve for k to find the number of iterations like so:
$0\le\frac{n}{2^k} <1$
$0\le n <2^k$
$-\infty \le log_2n <k$
So is it $ k \in O(log n)$ ?
Since it stops exactly when this relation is satisfied, we have $$ \log n < k \leq c' \log n $$ for any $c'>1,$ so you have the exact order, $$ k=\theta(\log n). $$