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 2015년 7월.
Math.atanh()
정적 메서드는 숫자의 역쌍곡 탄젠트를 반환합니다. 이는 다음과 같습니다.
시도해 보기
console.log(Math.atanh(-1));
// Expected output: -Infinity
console.log(Math.atanh(0));
// Expected output: 0
console.log(Math.atanh(0.5));
// Expected output: 0.549306144334055 (approximately)
console.log(Math.atanh(1));
// Expected output: Infinity
구문
js
Math.atanh(x)
매개변수
x
-
-1 이상 1 이하 숫자
반환 값
x
의 역 쌍곡 탄젠트. x
가 1이라면 Infinity
를 반환합니다. x
가 -1 이라면 -Infinity
을 반환합니다. x
가 -1보다 작거나 1보다 크다면 NaN
을 반환합니다.
설명
Math
의 정적 메서드이기 때문에 atanh()
는 생성한 Math
객체(Math
는 생성자가 아닙니다)의 메서드를 사용하기보다는 언제나 Math.atanh()
를 사용하세요.
예제
>Math.atanh() 사용하기
js
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
명세서
Specification |
---|
ECMAScript® 2026 Language Specification> # sec-math.atanh> |
브라우저 호환성
Loading…