<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a5a1e3ce-00fa-46e4-9a75-58c2aed9e8ce/Notion_Fundamentals_with_Thomas_Frank_-_Avatar_2021.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a5a1e3ce-00fa-46e4-9a75-58c2aed9e8ce/Notion_Fundamentals_with_Thomas_Frank_-_Avatar_2021.png" width="40px" /> $log_{2}$ can be used to perform an interesting mathematical trick – finding the length (i.e. number of digits) in any number when represented in binary. It is done by taking the floor value of a number’s $log_{2}$, then adding one:

$$ \lfloor log_{2}n \rfloor + 1 $$

The example database below shows this trick in action. Unfortunately, actual binary representation of a base-10 number in Notion is not possible (or at least has not been solved by the Notion community), but you can check the result using this converter.

Created by Thomas Frank | Learn Notion Formulas | Notion Basics | Templates | Twitter

</aside>

Length of a Number in Binary

// Compressed
floor(log2(prop("Num"))) + 1

// Expanded
floor(
    log2(
        prop("Num")
    )
) + 1

© Thomas Frank