Math.SQRT1_2
A propriedade Math.SQRT1_2
representa a raiz quadrada de
, que é aproximadamente 0.707:
Property attributes of Math.SQRT1_2 |
|
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
Descrição
Por SQRT1_2
ser um método estático de Math
, deve-se sempre usá-lo como Math.SQRT1_2()
, e não como um método de um objeto Math
que você criou.
Exemplos
Usando Math.SQRT1_2
A função a seguir retorna 1 sobre a raiz quadrada de 2:
js
function getRoot1_2() {
return Math.SQRT1_2;
}
getRoot1_2(); // 0.7071067811865476
Especificações
Specification | Status | Comment |
---|---|---|
ECMAScript 1st Edition (ECMA-262) | Padrão | Initial definition. Implemented in JavaScript 1.0. |
ECMAScript 5.1 (ECMA-262) The definition of 'Math.SQRT1_2' in that specification. |
Padrão | |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Math.SQRT1_2' in that specification. |
Padrão | |
ECMAScript (ECMA-262) The definition of 'Math.SQRT1_2' in that specification. |
Padrão em tempo real |
Compatibilidade com navegadores
BCD tables only load in the browser