From 39f2114f9797eb51994966c6bb8ff1814c9a4da8 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 12:36:08 +0100 Subject: unslug fr: move --- .../reference/global_objects/math/log1p/index.html | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 files/fr/web/javascript/reference/global_objects/math/log1p/index.html (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 new file mode 100644 index 0000000000..b209a76043 --- /dev/null +++ b/files/fr/web/javascript/reference/global_objects/math/log1p/index.html @@ -0,0 +1,99 @@ +--- +title: Math.log1p() +slug: Web/JavaScript/Reference/Objets_globaux/Math/log1p +tags: + - ECMAScript 2015 + - JavaScript + - Math + - Méthode + - Reference + - polyfill +translation_of: Web/JavaScript/Reference/Global_Objects/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