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

cmath.sqrt

Prev: cmath.sinh | Up: cmath | Next: cmath.tan
Rel: cmath.acos, cmath.acosh, cmath.asin, cmath.asinh
Ref: docs.python.org — cmath.sqrt
Tags: #public #python3 #stdlib #cmath


Import

import cmath
from cmath import sqrt

Signature & Overview

cmath.sqrt(z, /)

Return the square root of z.

Usage

import cmath

assert cmath.sqrt(-4) == 2j
assert cmath.isclose(cmath.sqrt(2j), 1 + 1j)

Gotchas

REPL Inspect

from cmath import sqrt
help(sqrt)

Linked from

Related notes