diff options
| author | julieng <julien.gattelier@gmail.com> | 2021-08-03 08:03:23 +0200 |
|---|---|---|
| committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-09-03 08:08:25 +0200 |
| commit | bf8e099b9c8b3c60d60b3712b4fc97b052c39887 (patch) | |
| tree | c101746d082c9581c94f5937519c7d0e2f4af8cb /files/fr/web/javascript/reference/global_objects/math/floor | |
| parent | 844f5103992238c0c23203286dad16a466e89c97 (diff) | |
| download | translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.tar.gz translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.tar.bz2 translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.zip | |
convert content to md
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/math/floor')
| -rw-r--r-- | files/fr/web/javascript/reference/global_objects/math/floor/index.md | 106 |
1 files changed, 39 insertions, 67 deletions
diff --git a/files/fr/web/javascript/reference/global_objects/math/floor/index.md b/files/fr/web/javascript/reference/global_objects/math/floor/index.md index 4b9a6e5422..65bc3d23fc 100644 --- a/files/fr/web/javascript/reference/global_objects/math/floor/index.md +++ b/files/fr/web/javascript/reference/global_objects/math/floor/index.md @@ -9,89 +9,61 @@ tags: translation_of: Web/JavaScript/Reference/Global_Objects/Math/floor original_slug: Web/JavaScript/Reference/Objets_globaux/Math/floor --- -<div>{{JSRef}}</div> +{{JSRef}} -<p>La fonction <code><strong>Math.floor(x)</strong></code> renvoie le plus grand entier qui est inférieur ou égal à un nombre <code>x</code>.</p> +La fonction **`Math.floor(x)`** renvoie le plus grand entier qui est inférieur ou égal à un nombre `x`. -<div>{{EmbedInteractiveExample("pages/js/math-floor.html")}}</div> +{{EmbedInteractiveExample("pages/js/math-floor.html")}} -<h2 id="Syntaxe">Syntaxe</h2> +## Syntaxe -<pre class="syntaxbox">Math.floor(<var>x</var>)</pre> + Math.floor(x) -<h3 id="Paramètres">Paramètres</h3> +### Paramètres -<dl> - <dt><code>x</code></dt> - <dd>Un nombre.</dd> -</dl> +- `x` + - : Un nombre. -<h3 id="Valeur_de_retour">Valeur de retour</h3> +### Valeur de retour -<p>Un nombre qui représente le plus grand entier inférieur ou égal à la valeur passée en argument.</p> +Un nombre qui représente le plus grand entier inférieur ou égal à la valeur passée en argument. -<h2 id="Description">Description</h2> +## Description -<p><code>floor()</code> est une méthode statique de l'objet <code>Math</code>, elle doit toujours être utilisée avec la syntaxe <code>Math.floor()</code>, elle ne doit pas être utilisée avec un autre objet qui aurait été créé (<code>Math</code> n'est pas un constructeur).</p> +`floor()` est une méthode statique de l'objet `Math`, elle doit toujours être utilisée avec la syntaxe `Math.floor()`, elle ne doit pas être utilisée avec un autre objet qui aurait été créé (`Math` n'est pas un constructeur). -<div class="blockIndicator note"> -<p><strong>Note :</strong> <code>Math.floor(null)</code> renvoie <code>0</code> et pas {{jsxref("NaN")}}.</p> -</div> +> **Note :** `Math.floor(null)` renvoie `0` et pas {{jsxref("NaN")}}. -<h2 id="Exemples">Exemples</h2> +## Exemples -<h3 id="Utiliser_Math.floor">Utiliser <code>Math.floor</code></h3> +### Utiliser `Math.floor` -<pre class="brush:js">Math.floor( 45.95); // 45 +```js +Math.floor( 45.95); // 45 Math.floor( 45.05); // 45 Math.floor( 4 ); // 4 Math.floor(-45.05); // -46 Math.floor(-45.95); // -46 Math.floor(null); // 0 -</pre> - -<h2 id="Spécifications">Spécifications</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Spécification</th> - <th scope="col">État</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.2.9', 'Math.floor')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td></td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-math.floor', 'Math.floor')}}</td> - <td>{{Spec2('ES6')}}</td> - <td></td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-math.floor', 'Math.floor')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td></td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> - -<p>{{Compat("javascript.builtins.Math.floor")}}</p> - -<h2 id="Voir_aussi">Voir aussi</h2> - -<ul> - <li>{{jsxref("Math.abs()")}}</li> - <li>{{jsxref("Math.ceil()")}}</li> - <li>{{jsxref("Math.round()")}}</li> - <li>{{jsxref("Math.sign()")}}</li> - <li>{{jsxref("Math.trunc()")}}</li> -</ul> +``` + +## Spécifications + +| Spécification | État | Commentaires | +| ---------------------------------------------------------------------------- | ---------------------------- | ----------------------------------------------------- | +| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Définition initiale. Implémentée avec JavaScript 1.0. | +| {{SpecName('ES5.1', '#sec-15.8.2.9', 'Math.floor')}} | {{Spec2('ES5.1')}} | | +| {{SpecName('ES6', '#sec-math.floor', 'Math.floor')}} | {{Spec2('ES6')}} | | +| {{SpecName('ESDraft', '#sec-math.floor', 'Math.floor')}} | {{Spec2('ESDraft')}} | | + +## Compatibilité des navigateurs + +{{Compat("javascript.builtins.Math.floor")}} + +## Voir aussi + +- {{jsxref("Math.abs()")}} +- {{jsxref("Math.ceil()")}} +- {{jsxref("Math.round()")}} +- {{jsxref("Math.sign()")}} +- {{jsxref("Math.trunc()")}} |
