# Logarithm (log)

Logarithm: natural with ln, or to any base with log.

Also written ln.

## How to write it

### ln(z)

The natural logarithm, to base e.

**z**

A number or expression, possibly complex. Takes a number.

### log(base, z)

The logarithm of z to the given base.

**base**

The base of the logarithm. Takes a number.

**z**

A number or expression, possibly complex. Takes a number.

## Examples

- $\displaystyle \ln(e) = 1$

  `ln(e)`

  In the solver, `ln(e)` gives `1`.

  [Open in the solver](https://hilberon.com/?q=ln%28e%29)
- $\displaystyle \log_{2}(8) = 3$

  `log(2, 8)`

  In the solver, `log(2, 8)` gives `3`.

  [Open in the solver](https://hilberon.com/?q=log%282%2C%208%29)

## Related functions

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

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

  Least common multiple of whole numbers.
- [log2](https://hilberon.com/library/log2)

  Logarithm to base 2.
- [im](https://hilberon.com/library/im)

  Imaginary part of a complex number.
- [max](https://hilberon.com/library/max)

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

  Greatest common divisor of whole numbers.

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