<< size Elementary functions squeeze >>

sqrt


Square root.


Syntax


R = sqrt(M)

Input argument


M

a variable

Output argument


R

result of sqrt: square root.

Description


sqrt computes the square root.

If input argument is a complex number or negative, sqrt(z) computes: sqrt(r) * (cos(phi/2) + sin(phi/2) * i) with

r = sqrt((real(z) * real(z)) + (imag(z) * imag(z))) and phi = atan2(imag(z), real(z))

Example


x = -3:3;
r = sqrt(x)

See also


log, abs, angle.

History


Version Description
1.0.0 initial version

Author


Allan CORNET

<< size Elementary functions squeeze >>