Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. JavaScript
  3. Reference
  4. Standard built-in objects
  5. Math
  6. atanh()

Math.atanh()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

TheMath.atanh() static method returns the inverse hyperbolic tangent of a number. That is,

x(1,1),𝙼𝚊𝚝𝚑.𝚊𝚝𝚊𝚗𝚑(𝚡)=artanh(x)=the unique y such that tanh(y)=x=12ln(1+x1x)\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}

Try it

console.log(Math.atanh(-1));// Expected output: -Infinityconsole.log(Math.atanh(0));// Expected output: 0console.log(Math.atanh(0.5));// Expected output: 0.549306144334055 (approximately)console.log(Math.atanh(1));// Expected output: Infinity

Syntax

js
Math.atanh(x)

Parameters

x

A number between -1 and 1, inclusive.

Return value

The inverse hyperbolic tangent ofx. Ifx is 1, returnsInfinity. Ifx is -1, returns-Infinity. Ifx is less than -1 or greater than 1, returnsNaN.

Description

Becauseatanh() is a static method ofMath, you always use it asMath.atanh(), rather than as a method of aMath object you created (Math is not a constructor).

Examples

Using Math.atanh()

js
Math.atanh(-2); // NaNMath.atanh(-1); // -InfinityMath.atanh(-0); // -0Math.atanh(0); // 0Math.atanh(0.5); // 0.5493061443340548Math.atanh(1); // InfinityMath.atanh(2); // NaN

Specifications

Specification
ECMAScript® 2026 Language Specification
# sec-math.atanh

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp