summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/lib/scimath.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/numpy/lib/scimath.py b/numpy/lib/scimath.py
index d601cbd14..ed04d1ce5 100644
--- a/numpy/lib/scimath.py
+++ b/numpy/lib/scimath.py
@@ -192,6 +192,22 @@ def sqrt(x):
>>> np.lib.scimath.sqrt([-1,4])
array([ 0.+1.j, 2.+0.j])
+
+ Notes
+ -----
+
+ As the numpy.sqrt, this returns the principal square root of x, which is
+ what most people mean when they use square root; the principal square root
+ of x is not any number z such as z^2 = x.
+
+ For positive numbers, the principal square root is defined as the positive
+ number z such as z^2 = x.
+
+ The principal square root of -1 is i, the principal square root of any
+ negative number -x is defined a i * sqrt(x). For any non zero complex
+ number, it is defined by using the following branch cut: x = r e^(i t) with
+ r > 0 and -pi < t <= pi. The principal square root is then
+ sqrt(r) e^(i t/2).
"""
x = _fix_real_lt_zero(x)
return nx.sqrt(x)