A RetroSearch Logo

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

Search Query:

Showing content from https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh below:

Math.tanh() - JavaScript | MDN

Math.tanh()

Baseline Widely available

Math.tanh() 静的メソッドは、数値のハイパーボリックタンジェントを返します。

𝙼𝚊𝚝𝚑.𝚝𝚊𝚗𝚑 ( 𝚡 ) = tanh ( x ) = sinh ( x ) cosh ( x ) = ex − e − x ex + e − x = e 2 x − 1 e 2 x + 1 \mathtt{\operatorname{Math.tanh}(x)} = \tanh(x) = \frac{\sinh(x)}{\cosh(x)} = \frac{\mathrm{e}^x - \mathrm{e}^{-x}}{\mathrm{e}^x + \mathrm{e}^{-x}} = \frac{\mathrm{e}^{2x} - 1}{\mathrm{e}^{2x}+1} 試してみましょう
console.log(Math.tanh(-1));
// Expected output: -0.7615941559557649

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

console.log(Math.tanh(Infinity));
// Expected output: 1

console.log(Math.tanh(1));
// Expected output: 0.7615941559557649
構文 引数 返値

x のハイパーボリックタンジェントです。

解説

tanh() は Math の静的メソッドであるため、生成した Math オブジェクトのメソッドとしてではなく、常に Math.tanh() として使用するようにしてください (Math はコンストラクターではありません)。

例 Math.tanh() の使用
Math.tanh(-Infinity); // -1
Math.tanh(-0); // -0
Math.tanh(0); // 0
Math.tanh(1); // 0.7615941559557649
Math.tanh(Infinity); // 1
仕様書 ブラウザーの互換性 関連情報

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