> For the complete documentation index, see [llms.txt](https://nelson-9.gitbook.io/nelson/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nelson-9.gitbook.io/nelson/markdown/en/elementary_functions/sqrt.md).

# 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.

For real positive numbers: $$\sqrt{x}$$

For complex numbers z = x + iy: $$\sqrt{z} = \sqrt{r} e^{i\phi/2}$$

where $$r = |z| = \sqrt{x^2 + y^2}$$

and $$\phi = \arg(z) = \text{atan2}(y, x)$$

## 💡 Example

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

## 🔗 See also

[log](/nelson/markdown/en/elementary_functions/log.md), [abs](/nelson/markdown/en/elementary_functions/abs.md), [angle](/nelson/markdown/en/elementary_functions/angle.md).

## 🕔 History

| Version | 📄 Description  |
| ------- | --------------- |
| 1.0.0   | initial version |
