From 844f5103992238c0c23203286dad16a466e89c97 Mon Sep 17 00:00:00 2001 From: julieng Date: Tue, 3 Aug 2021 08:03:09 +0200 Subject: move *.html to *.md --- .../reference/global_objects/math/log1p/index.html | 96 ---------------------- .../reference/global_objects/math/log1p/index.md | 96 ++++++++++++++++++++++ 2 files changed, 96 insertions(+), 96 deletions(-) delete mode 100644 files/fr/web/javascript/reference/global_objects/math/log1p/index.html create mode 100644 files/fr/web/javascript/reference/global_objects/math/log1p/index.md (limited to 'files/fr/web/javascript/reference/global_objects/math/log1p') diff --git a/files/fr/web/javascript/reference/global_objects/math/log1p/index.html b/files/fr/web/javascript/reference/global_objects/math/log1p/index.html deleted file mode 100644 index 04913b856c..0000000000 --- a/files/fr/web/javascript/reference/global_objects/math/log1p/index.html +++ /dev/null @@ -1,96 +0,0 @@ ---- -title: Math.log1p() -slug: Web/JavaScript/Reference/Global_Objects/Math/log1p -tags: - - ECMAScript 2015 - - JavaScript - - Math - - Méthode - - Reference - - polyfill -translation_of: Web/JavaScript/Reference/Global_Objects/Math/log1p -original_slug: Web/JavaScript/Reference/Objets_globaux/Math/log1p ---- -
{{JSRef}}
- -

La fonction Math.log1p() renvoie le logarithme népérien (en base {{jsxref("Math/E","e")}}) d'un nombre +1, donné par la formule :

- -

x>-1,Math.log1p(x)=ln(1+x)\forall x > -1, \mathtt{\operatorname{Math.log1p}(x)} = \ln(1 + x)

- -
{{EmbedInteractiveExample("pages/js/math-log1p.html")}}
- -

Syntaxe

- -
Math.log1p(x)
- -

Paramètres

- -
-
x
-
Un nombre.
-
- -

Valeur de retour

- -

La valeur du logarithme naturel de 1 plus l'argument (log(1 + x)). Si l'argument est inférieur à -1, {{jsxref("NaN")}} est renvoyée.

- -

Description

- -

Si x est strictement inférieur à -1, la valeur renvoyée est {{jsxref("NaN")}}.

- -

log1p étant une méthode statique de Math, il faut utiliser Math.log1p() et non pas la méthode d'un autre objet qui aurait été créé (Math n'est pas un constructeur).

- -

Exemple

- -

Utiliser Math.log1p()

- -
Math.log1p(1);  // 0.6931471805599453
-Math.log1p(0);  // 0
-Math.log1p(-1); // -Infinity
-Math.log1p(-2); // NaN
-
- -

Prothèse d'émulation (polyfill)

- -

Si cette fonction n'est pas disponible, elle peut être définie grâce au code suivant :

- -
Math.log1p = Math.log1p || function(x) {
-  return Math.log(1 + x);
-};
-
- -

Spécifications

- - - - - - - - - - - - - - - - - - - -
SpécificationÉtatCommentaires
{{SpecName('ES2015', '#sec-math.log1p', 'Math.log1p')}}{{Spec2('ES2015')}}Définition initiale.
{{SpecName('ESDraft', '#sec-math.log1p', 'Math.log1p')}}{{Spec2('ESDraft')}} 
- -

Compatibilité des navigateurs

- -

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

- -

Voir aussi

- - diff --git a/files/fr/web/javascript/reference/global_objects/math/log1p/index.md b/files/fr/web/javascript/reference/global_objects/math/log1p/index.md new file mode 100644 index 0000000000..04913b856c --- /dev/null +++ b/files/fr/web/javascript/reference/global_objects/math/log1p/index.md @@ -0,0 +1,96 @@ +--- +title: Math.log1p() +slug: Web/JavaScript/Reference/Global_Objects/Math/log1p +tags: + - ECMAScript 2015 + - JavaScript + - Math + - Méthode + - Reference + - polyfill +translation_of: Web/JavaScript/Reference/Global_Objects/Math/log1p +original_slug: Web/JavaScript/Reference/Objets_globaux/Math/log1p +--- +
{{JSRef}}
+ +

La fonction Math.log1p() renvoie le logarithme népérien (en base {{jsxref("Math/E","e")}}) d'un nombre +1, donné par la formule :

+ +

x>-1,Math.log1p(x)=ln(1+x)\forall x > -1, \mathtt{\operatorname{Math.log1p}(x)} = \ln(1 + x)

+ +
{{EmbedInteractiveExample("pages/js/math-log1p.html")}}
+ +

Syntaxe

+ +
Math.log1p(x)
+ +

Paramètres

+ +
+
x
+
Un nombre.
+
+ +

Valeur de retour

+ +

La valeur du logarithme naturel de 1 plus l'argument (log(1 + x)). Si l'argument est inférieur à -1, {{jsxref("NaN")}} est renvoyée.

+ +

Description

+ +

Si x est strictement inférieur à -1, la valeur renvoyée est {{jsxref("NaN")}}.

+ +

log1p étant une méthode statique de Math, il faut utiliser Math.log1p() et non pas la méthode d'un autre objet qui aurait été créé (Math n'est pas un constructeur).

+ +

Exemple

+ +

Utiliser Math.log1p()

+ +
Math.log1p(1);  // 0.6931471805599453
+Math.log1p(0);  // 0
+Math.log1p(-1); // -Infinity
+Math.log1p(-2); // NaN
+
+ +

Prothèse d'émulation (polyfill)

+ +

Si cette fonction n'est pas disponible, elle peut être définie grâce au code suivant :

+ +
Math.log1p = Math.log1p || function(x) {
+  return Math.log(1 + x);
+};
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName('ES2015', '#sec-math.log1p', 'Math.log1p')}}{{Spec2('ES2015')}}Définition initiale.
{{SpecName('ESDraft', '#sec-math.log1p', 'Math.log1p')}}{{Spec2('ESDraft')}} 
+ +

Compatibilité des navigateurs

+ +

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

+ +

Voir aussi

+ + -- cgit v1.2.3-54-g00ecf