asd/asd-pc/node_modules/core-js/modules/es.math.atanh.js
愉快的大福 eb8378e551 init
2024-11-21 11:06:22 +08:00

16 lines
446 B
JavaScript

var $ = require('../internals/export');
// eslint-disable-next-line es-x/no-math-atanh -- required for testing
var $atanh = Math.atanh;
var log = Math.log;
// `Math.atanh` method
// https://tc39.es/ecma262/#sec-math.atanh
// Tor Browser bug: Math.atanh(-0) -> 0
$({ target: 'Math', stat: true, forced: !($atanh && 1 / $atanh(-0) < 0) }, {
atanh: function atanh(x) {
var n = +x;
return n == 0 ? n : log((1 + n) / (1 - n)) / 2;
}
});