Iteration Count for Russian

From this little aside, it is apparent that the number of iterations it takes to square a is $\log(a)$.

To be more precise, the exact number of iterations is $1+\lfloor \log(a)\rfloor$.

Here, the ``floor'' function, $\lfloor x \rfloor$ is the largest integer not exceeding x (rounding down). This is in contrast to the ``ceiling'' function $\lceil x \rceil$, which rounds up.

We will prove this bound next time, and introduce another (recursive) way of writing the algorithm.


next up previous
Up: ANALYZING RUSSIAN Previous: Fun With Logarithms