Files
freeCodeCamp/guide/russian/javascript/standard-objects/math/math-sqrt/index.md
2018-10-16 21:32:40 +05:30

29 lines
845 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Math Sqrt
localeTitle: Math Sqrt
---
## Math Sqrt
Функция `Math.sqrt()` возвращает квадратный корень из числа.
Если введено отрицательное число, возвращается `NaN` .
`sqrt()` является статическим методом `Math` , поэтому он всегда называется `Math.sqrt()` а не как метод для другого объекта.
#### Синтаксис
`Math.sqrt(x)` , где `x` - число.
#### Примеры
```js
Math.sqrt(25); // 5
Math.sqrt(169); // 13
Math.sqrt(3); // 1.732050807568
Math.sqrt(1); // 1
Math.sqrt(-5); // NaN
```
#### Дополнительная информация:
[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt)