aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/javascript/reference/global_objects/math/sqrt2
diff options
context:
space:
mode:
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/math/sqrt2')
-rw-r--r--files/fr/web/javascript/reference/global_objects/math/sqrt2/index.html80
1 files changed, 80 insertions, 0 deletions
diff --git a/files/fr/web/javascript/reference/global_objects/math/sqrt2/index.html b/files/fr/web/javascript/reference/global_objects/math/sqrt2/index.html
new file mode 100644
index 0000000000..7a02b16e2d
--- /dev/null
+++ b/files/fr/web/javascript/reference/global_objects/math/sqrt2/index.html
@@ -0,0 +1,80 @@
+---
+title: Math.SQRT2
+slug: Web/JavaScript/Reference/Objets_globaux/Math/SQRT2
+tags:
+ - JavaScript
+ - Math
+ - Propriété
+ - Reference
+translation_of: Web/JavaScript/Reference/Global_Objects/Math/SQRT2
+---
+<div>{{JSRef}}</div>
+
+<p>La propriété <code><strong>Math.SQRT2</strong></code> représente la racine carrée de 2 et vaut environ 1.414 :</p>
+
+<p><math display="block"><semantics><mrow><mstyle mathvariant="monospace"><mi>Math.SQRT2</mi></mstyle><mo>=</mo><msqrt><mn>2</mn></msqrt><mo>≈</mo><mn>1.414</mn></mrow><annotation encoding="TeX">\mathtt{\mi{Math.SQRT2}} = \sqrt{2} \approx 1.414</annotation></semantics></math></p>
+
+<div>{{EmbedInteractiveExample("pages/js/math-sqrt2.html")}}</div>
+
+<p class="hidden">Le code source de cet exemple interactif est disponible dans un dépôt GitHub. Si vous souhaitez contribuez à ces exemples, n'hésitez pas à cloner <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> et à envoyer une <em>pull request</em> !</p>
+
+<div>{{js_property_attributes(0,0,0)}}</div>
+
+<h2 id="Description">Description</h2>
+
+<p><code>SQRT2</code> est une propriété statique de <code>Math</code> et doit toujours être utilisée avec la syntaxe <code>Math.SQRT2</code>, elle ne doit pas être appelée comme propriété d'un autre objet qui aurait été créé (<code>Math</code> n'est pas un constructeur).</p>
+
+<h2 id="Exemples">Exemples</h2>
+
+<p>La fonction suivante renvoie la valeur de la racine carrée de 2 :</p>
+
+<pre class="brush:js">function getRoot2() {
+ return Math.SQRT2;
+}
+
+getRoot2(); // 1.4142135623730951</pre>
+
+<h2 id="Spécifications">Spécifications</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Spécification</th>
+ <th scope="col">Statut</th>
+ <th scope="col">Commentaires</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES1')}}</td>
+ <td>{{Spec2('ES1')}}</td>
+ <td>Définition initiale. Implémentée avec JavaScript 1.0.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.8.1.8', 'Math.SQRT2')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-math.sqrt2', 'Math.SQRT2')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-math.sqrt2', 'Math.SQRT2')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
+
+<p class="hidden">Le tableau de compatibilité de cette page a été généré à partir de données structurées. Si vous souhaitez contribuer à ces données, n'hésitez pas à envoyer une <em>pull request</em> sur <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>.</p>
+
+<p>{{Compat("javascript.builtins.Math.SQRT2")}}</p>
+
+<h2 id="Voir_aussi">Voir aussi</h2>
+
+<ul>
+ <li>{{jsxref("Math.pow()")}}</li>
+ <li>{{jsxref("Math.sqrt()")}}</li>
+</ul>