From bf8e099b9c8b3c60d60b3712b4fc97b052c39887 Mon Sep 17 00:00:00 2001 From: julieng Date: Tue, 3 Aug 2021 08:03:23 +0200 Subject: convert content to md --- .../reference/global_objects/math/floor/index.md | 106 ++++++++------------- 1 file changed, 39 insertions(+), 67 deletions(-) (limited to 'files/fr/web/javascript/reference/global_objects/math/floor') 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 --- -
{{JSRef}}
+{{JSRef}} -

La fonction Math.floor(x) renvoie le plus grand entier qui est inférieur ou égal à un nombre x.

+La fonction **`Math.floor(x)`** renvoie le plus grand entier qui est inférieur ou égal à un nombre `x`. -
{{EmbedInteractiveExample("pages/js/math-floor.html")}}
+{{EmbedInteractiveExample("pages/js/math-floor.html")}} -

Syntaxe

+## Syntaxe -
Math.floor(x)
+ Math.floor(x) -

Paramètres

+### Paramètres -
-
x
-
Un nombre.
-
+- `x` + - : Un nombre. -

Valeur de retour

+### Valeur de retour -

Un nombre qui représente le plus grand entier inférieur ou égal à la valeur passée en argument.

+Un nombre qui représente le plus grand entier inférieur ou égal à la valeur passée en argument. -

Description

+## Description -

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).

+`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). -
-

Note : Math.floor(null) renvoie 0 et pas {{jsxref("NaN")}}.

-
+> **Note :** `Math.floor(null)` renvoie `0` et pas {{jsxref("NaN")}}. -

Exemples

+## Exemples -

Utiliser Math.floor

+### Utiliser `Math.floor` -
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
-
- -

Spécifications

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpécificationÉtatCommentaires
{{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

- - +``` + +## 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()")}} -- cgit v1.2.3-54-g00ecf