Math.tanh()
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.tanh() ã¯éçã¡ã½ããã§ãæ°å¤ã®ãã¤ãã¼ããªãã¯ã¿ã³ã¸ã§ã³ããè¿ãã¾ãã
試ãã¦ã¿ã¾ããã
console.log(Math.tanh(-1));
// äºæ³ãããçµæ: -0.7615941559557649
console.log(Math.tanh(0));
// äºæ³ãããçµæ: 0
console.log(Math.tanh(Infinity));
// äºæ³ãããçµæ: 1
console.log(Math.tanh(1));
// äºæ³ãããçµæ: 0.7615941559557649
æ§æ
js
Math.tanh(x)
弿°
x-
æ°å¤ã§ãã
è¿å¤
x ã®ãã¤ãã¼ããªãã¯ã¿ã³ã¸ã§ã³ãã§ãã
解説
tanh() 㯠Math ã®éçã¡ã½ããã§ãããããçæãã Math ãªãã¸ã§ã¯ãã®ã¡ã½ããã¨ãã¦ã§ã¯ãªãã常㫠Math.tanh() ã¨ãã¦ä½¿ç¨ããããã«ãã¦ãã ãã (Math ã¯ã³ã³ã¹ãã©ã¯ã¿ã¼ã§ã¯ããã¾ãã)ã
ä¾
>Math.tanh() ã®ä½¿ç¨
js
Math.tanh(-Infinity); // -1
Math.tanh(-0); // -0
Math.tanh(0); // 0
Math.tanh(1); // 0.7615941559557649
Math.tanh(Infinity); // 1
仿§æ¸
| Specification |
|---|
| ECMAScript® 2026 Language Specification > # sec-math.tanh > |