# Base-2 logarithm (log2)

Logarithm to base 2.

## How to write it

### log2(z)

**z**

A number, possibly complex. Takes an expression.

## Examples

- $\displaystyle \log_{2}(8) = 3$

  `log2(8)`

  In the solver, `log2(8)` gives `3`.

  [Open in the solver](https://hilberon.com/?q=log2%288%29)

## Related functions

- [max](https://hilberon.com/library/max)

  The largest of some numbers.
- [log10](https://hilberon.com/library/log10)

  Logarithm to base 10.
- [min](https://hilberon.com/library/min)

  The smallest of some numbers.
- [log](https://hilberon.com/library/log)

  Logarithm: natural with ln, or to any base with log.
- [mod](https://hilberon.com/library/mod)

  Remainder of a division of whole numbers.
- [lcm](https://hilberon.com/library/lcm)

  Least common multiple of whole numbers.

---
Source: https://hilberon.com/library/log2
