Math.SQRT1_2

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

La propriété Math.SQRT1_2 représente la racine carrée d'1/2 et vaut environ 0.707 :

Math.SQRT1_2=12=120.707\mathtt{\mi{Math.SQRT1_2}} = \sqrt{\frac{1}{2}} = \frac{1}{\sqrt{2}} \approx 0.707

Exemple interactif

function getRoot1Over2() {
  return Math.SQRT1_2;
}

console.log(getRoot1Over2());
// Expected output: 0.7071067811865476
Attributs de Math.SQRT1_2
ÉcrivableNon
ÉnumérableNon
ConfigurableNon

Description

SQRT1_2 est une propriété statique de Math et doit toujours être utilisée avec la syntaxe Math.SQRT1_2. Elle ne doit pas être obtenue à partir d'un autre objet qui aurait été créé (Math n'est pas un constructeur).

Exemples

La fonction suivante renvoie la valeur de cette constante :

js
function getRoot1_2() {
  return Math.SQRT1_2;
}

getRoot1_2(); // 0.7071067811865476

Spécifications

Specification
ECMAScript® 2025 Language Specification
# sec-math.sqrt1_2

Compatibilité des navigateurs

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
SQRT1_2

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Voir aussi