Python math.sqrt() Method

cmath Methods : Find the square root of a complex number

Definition and Usage

The cmath.sqrt() method returns the square root of a complex number.

Note: The number must be greater than or equal to 0.

Syntax

cmath.sqrt(x)

Parameter Values

Parameter Description
x Required. A number to find the square root of. If the number is less than 0, it returns a ValueError. If the value is not a number, it returns a TypeError

Technical Details

Return Value: A complex value, representing the square root of a complex number
Python Version: 1.5