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
è¯æ³ åæ° è¿åå¼
æç»æ°åçåæ²æ£åå¼ã
æè¿°å 为 tanh()
æ¯ Math
çéææ¹æ³ï¼æä»¥æ»åºè¯¥ç´æ¥è°ç¨ Math.tanh()
ï¼è䏿¯å建 Math
对象åè°ç¨è¯¥æ¹æ³ï¼Math
䏿¯ä¸ä¸ªæé 彿°ï¼ã
Math.tanh()
Math.tanh(0); // 0
Math.tanh(Infinity); // 1
Math.tanh(1); // 0.7615941559557649
åä¸å
¼å®¹
tanh()
å¯ä»¥éè¿ Math.exp()
彿°å®ç°ï¼
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