On this page
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
- Principal branch cut along the negative real axis:
log(0)raisesValueError.
REPL Inspect
from cmath import log
help(log)
Linked from
Related notes
- tuts/python3/stdlib_module/cmath/isnan Linked here; links to this page; shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/log10 Linked here; links to this page; shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/cmath/acos Linked here; shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/acosh Linked here; shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/asin Linked here; shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/asinh Linked here; shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/atan shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/atanh shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/cos shared tags: #cmath, #stdlib