--- title: "log2" excerpt: "Computes the base 2 logarithm of the number." layout: manual --- Computes the base 2 logarithm of the number. ```js log2(num: number) -> number ``` ### Tags * `math` ### Examples ```js const myVar = log2(4) ``` ### Arguments * `num`: `number` (REQUIRED) ### Returns `number`