Baseline Widely available
Math.tanh()
í¨ìë ì곡íì í¸ ê°ì ë°íí©ëë¤. ììì¼ë¡ë ìëì ê°ìµëë¤.
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
Syntax íë¼ë¯¸í° ë°í ê°
주ì´ì§ ìì ì곡íì í¸ ê°
ì¤ëªtanh()
ì Math
ì ì ì ë©ìëì´ë¯ë¡ ì¬ì©ìê° ë§ë Math
ê°ì²´ì ë©ìëê° ìë íì Math.tanh()
ì¼ë¡ ì¬ì©í©ëë¤ (Math
ë ìì±ìê° ìëëë¤.).
Math.tanh()
Math.tanh(0); // 0
Math.tanh(Infinity); // 1
Math.tanh(1); // 0.7615941559557649
Polyfill
This can be emulated with the help of the Math.exp()
function:
Math.tanh =
Math.tanh ||
function (x) {
var a = Math.exp(+x),
b = Math.exp(-x);
return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (a + b);
};
ëª
ì¸ì ë¸ë¼ì°ì í¸íì± í¨ê» 보기
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