Floor Function/Examples/Floor of Binary Logarithm of 35
Jump to navigation
Jump to search
Theorem
- $\floor {\lg 35} = 5$
where:
- $\lg x$ denotes the binary logarithm ($\log_2$) of $x$
- $\floor x$ denotes the floor of $x$.
Proof
\(\ds \lg 32\) | \(\le\) | \(\, \ds \lg 35 \, \) | \(\, \ds < \, \) | \(\ds \lg 64\) | ||||||||||
\(\ds \leadsto \ \ \) | \(\ds 5\) | \(\le\) | \(\, \ds \lg 35 \, \) | \(\, \ds < \, \) | \(\ds 6\) |
Hence $5$ is the floor of $\lg 35$ by definition.
$\blacksquare$
Sources
- 1997: Donald E. Knuth: The Art of Computer Programming: Volume 1: Fundamental Algorithms (3rd ed.) ... (previous) ... (next): $\S 1.2.4$: Integer Functions and Elementary Number Theory: Exercise $1$