A RetroSearch Logo

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

Search Query:

Showing content from https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh below:

Math.atanh() - JavaScript | MDN

Math.atanh()

Baseline Widely available

Math.atanh() 靜態方法回傳一個數字的反雙曲正切值,也就是說,

∀ x ∊ ( − 1 , 1 ) , 𝙼𝚊𝚝𝚑.𝚊𝚝𝚊𝚗𝚑 ( 𝚡 ) = artanh ( x ) = the unique  y  such that  tanh ( y ) = x = 1 2 ln ( 1 + x 1 − x ) \begin{aligned}\forall x \in ({-1}, 1),\;\mathtt{\operatorname{Math.atanh}(x)} &= \operatorname{artanh}(x) = \text{the unique } y \text{ such that } \tanh(y) = x \\&= \frac{1}{2}\,\ln\left(\frac{1+x}{1-x}\right)\end{aligned} 嘗試一下
console.log(Math.atanh(-1));
// 預期輸出:-Infinity

console.log(Math.atanh(0));
// 預期輸出:0

console.log(Math.atanh(0.5));
// 預期輸出:0.549306144334055 (approximately)

console.log(Math.atanh(1));
// 預期輸出:Infinity
語法 參數
x

一個介於 -1 和 1 之間的數字(包含邊界)。

回傳值

x 的反雙曲正切值。如果 x 為 1,返回 Infinity。如果 x 為 -1,返回 -Infinity。如果 x 小於 -1 或大於 1,返回 NaN。

描述

由於 atanh() 是 Math 的靜態方法,你必須使用 Math.atanh() 來呼叫它,而非呼叫你所建立的 Math 物件的方法(Math 並非建構子)。

範例 使用 Math.atanh()
Math.atanh(-2); // NaN
Math.atanh(-1); // -Infinity
Math.atanh(-0); // -0
Math.atanh(0); // 0
Math.atanh(0.5); // 0.5493061443340548
Math.atanh(1); // Infinity
Math.atanh(2); // NaN
規範 瀏覽器相容性 參見

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