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/ceil/index.md | 118 ++++++++------------- 1 file changed, 46 insertions(+), 72 deletions(-) (limited to 'files/fr/web/javascript/reference/global_objects/math/ceil') diff --git a/files/fr/web/javascript/reference/global_objects/math/ceil/index.md b/files/fr/web/javascript/reference/global_objects/math/ceil/index.md index 93e8919368..fced464d1b 100644 --- a/files/fr/web/javascript/reference/global_objects/math/ceil/index.md +++ b/files/fr/web/javascript/reference/global_objects/math/ceil/index.md @@ -9,52 +9,51 @@ tags: translation_of: Web/JavaScript/Reference/Global_Objects/Math/ceil original_slug: Web/JavaScript/Reference/Objets_globaux/Math/ceil --- -
{{JSRef}}
+{{JSRef}} -

La fonction Math.ceil() retourne le plus petit entier supérieur ou égal au nombre donné.

+La fonction **`Math.ceil()`** retourne le plus petit entier supérieur ou égal au nombre donné. -
{{EmbedInteractiveExample("pages/js/math-ceil.html")}}
+{{EmbedInteractiveExample("pages/js/math-ceil.html")}} -

Syntaxe

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

Paramètres

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

Valeur de retour

+### Valeur de retour -

Le plus petit entier qui est supérieur ou égal au nombre donné.

+Le plus petit entier qui est supérieur ou égal au nombre donné. -

Description

+## Description -

ceil() est une méthode statique de Math. Elle doit être utilisée avec la syntaxe Math.ceil(), plutôt que comme une méthode d'un autre objet qui aurait été créé (Math n'est pas un constructeur).

+`ceil()` est une méthode statique de `Math`. Elle doit être utilisée avec la syntaxe `Math.ceil()`, plutôt que comme une méthode d'un autre objet qui aurait été créé (`Math` n'est pas un constructeur). -
-

Note : Math.ceil(null) renverra 0 et pas {{jsxref("NaN")}}.

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

Exemples

+## Exemples -

Utiliser Math.ceil()

+### Utiliser `Math.ceil()` -

Voici un exemple d'utilisation de Math.ceil().

+Voici un exemple d'utilisation de `Math.ceil()`. -
Math.ceil(.95);    // 1
+```js
+Math.ceil(.95);    // 1
 Math.ceil(4);      // 4
 Math.ceil(7.004);  // 8
 Math.ceil(-0.95);  // -0
 Math.ceil(-4);     // -4
 Math.ceil(-7.004); // -7
-Math.ceil(null);   // 0
+Math.ceil(null); // 0 +``` -

Arrondi décimal

+### Arrondi décimal -
// Fermeture
+```js
+// Fermeture
 (function(){
 
 	/**
@@ -74,7 +73,7 @@ Math.ceil(null);   // 0
exp = +exp; // Si value n'est pas un nombre // ou si l'exposant n'est pas entier - if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) { + if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) { return NaN; } // Décalage @@ -125,50 +124,25 @@ Math.ceil10(55.51, -1); // 55.6 Math.ceil10(51, 1); // 60 Math.ceil10(-55.59, -1); // -55.5 Math.ceil10(-59, 1); // -50 - - -

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.6', 'Math.ceil')}}{{Spec2('ES5.1')}}
{{SpecName('ES6', '#sec-math.ceil', 'Math.ceil')}}{{Spec2('ES6')}}
{{SpecName('ESDraft', '#sec-math.ceil', 'Math.ceil')}}{{Spec2('ESDraft')}}
- -

Compatibilité des navigateurs

- -

{{Compat("javascript.builtins.Math.ceil")}}

- -

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.6', 'Math.ceil')}} | {{Spec2('ES5.1')}} | | +| {{SpecName('ES6', '#sec-math.ceil', 'Math.ceil')}} | {{Spec2('ES6')}} | | +| {{SpecName('ESDraft', '#sec-math.ceil', 'Math.ceil')}} | {{Spec2('ESDraft')}} | | + +## Compatibilité des navigateurs + +{{Compat("javascript.builtins.Math.ceil")}} + +## Voir aussi + +- {{jsxref("Math.abs()")}} +- {{jsxref("Math.floor()")}} +- {{jsxref("Math.round()")}} +- {{jsxref("Math.sign()")}} +- {{jsxref("Math.trunc()")}}{ -- cgit v1.2.3-54-g00ecf