On this page
  1. cmath.log
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

cmath.log

Prev: cmath.isnan | Up: cmath | Next: cmath.log10
Rel: cmath.acos, cmath.acosh, cmath.asin, cmath.asinh
Ref: docs.python.org — cmath.log
Tags: #public #python3 #stdlib #cmath


Import

import cmath
from cmath import log

Signature & Overview

cmath.log(z[, base]) -> the logarithm of z to the given base.

If the base is not specified, returns the natural logarithm (base e) of z.

Usage

import cmath

assert cmath.isclose(cmath.log(-1), 1j * cmath.pi)
assert cmath.isclose(cmath.log(100, 10), 2)

Gotchas

REPL Inspect

from cmath import log
help(log)

Linked from

Related notes