A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1 below:

Math.expm1() - JavaScript | MDN

Math.expm1()

Baseline Widely available

The Math.expm1() function returns ex - 1, where x is the argument, and e the base of the natural logarithms.

Experimente
console.log(Math.expm1(0));
// Expected output: 0

console.log(Math.expm1(1));
// Expected output: 1.718281828459045

console.log(Math.expm1(-1));
// Expected output: -0.6321205588285577

console.log(Math.expm1(2));
// Expected output: 6.38905609893065
Syntax Parameters Return value

Um número representando ex - 1, onde e é Euler's number e x ié o argumento.

Description

Porque expm1() é um método estático de is Math, você sempre o usurá como Math.expm1(), do que como um método de um objeto Math que você criou (Math não é um contrutor).

Polyfill

This can be emulated with the help of the Math.exp() function:

Math.expm1 =
  Math.expm1 ||
  function (x) {
    return Math.exp(x) - 1;
  };
Examples Using Math.expm1()
Math.expm1(-1); // -0.6321205588285577
Math.expm1(0); // 0
Math.expm1(1); // 1.718281828459045
Especificações Compatibilidade com navegadores See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4