|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
674 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 | var $ = require('../internals/export');
|
|---|
| 3 |
|
|---|
| 4 | // eslint-disable-next-line es/no-math-asinh -- required for testing
|
|---|
| 5 | var $asinh = Math.asinh;
|
|---|
| 6 | var log = Math.log;
|
|---|
| 7 | var sqrt = Math.sqrt;
|
|---|
| 8 | var LN2 = Math.LN2;
|
|---|
| 9 | // sqrt(2 ** 53) - prevent n * n overflow
|
|---|
| 10 | var SQRT_2_POW_53 = 94906265.62425156;
|
|---|
| 11 |
|
|---|
| 12 | function asinh(x) {
|
|---|
| 13 | var n = +x;
|
|---|
| 14 | return !isFinite(n) || n === 0 ? n : n < 0 ? -asinh(-n) : n > SQRT_2_POW_53 ? log(n) + LN2 : log(n + sqrt(n * n + 1));
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | var FORCED = !($asinh && 1 / $asinh(0) > 0);
|
|---|
| 18 |
|
|---|
| 19 | // `Math.asinh` method
|
|---|
| 20 | // https://tc39.es/ecma262/#sec-math.asinh
|
|---|
| 21 | // Tor Browser bug: Math.asinh(0) -> -0
|
|---|
| 22 | $({ target: 'Math', stat: true, forced: FORCED }, {
|
|---|
| 23 | asinh: asinh
|
|---|
| 24 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.