A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT2 below:

Math.SQRT2 - JavaScript | MDN

Math.SQRT2

Baseline Widely available

La propriété Math.SQRT2 représente la racine carrée de 2 et vaut environ 1.414 :

Math.SQRT2 = 2 ≈ 1.414 \mathtt{\mi{Math.SQRT2}} = \sqrt{2} \approx 1.414 Exemple interactif
function getRoot2() {
  return Math.SQRT2;
}

console.log(getRoot2());
// Expected output: 1.4142135623730951
Écrivable Non Énumérable Non Configurable Non Description

SQRT2 est une propriété statique de Math et doit toujours être utilisée avec la syntaxe Math.SQRT2, elle ne doit pas être appelée comme propriété d'un autre objet qui aurait été créé (Math n'est pas un constructeur).

Exemples

La fonction suivante renvoie la valeur de la racine carrée de 2 :

function getRoot2() {
  return Math.SQRT2;
}

getRoot2(); // 1.4142135623730951
Spécifications Compatibilité des navigateurs Voir aussi

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4