Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
643 bytes
|
Line | |
---|
1 | var $ = require('../internals/export');
|
---|
2 | var fails = require('../internals/fails');
|
---|
3 | var expm1 = require('../internals/math-expm1');
|
---|
4 |
|
---|
5 | var abs = Math.abs;
|
---|
6 | var exp = Math.exp;
|
---|
7 | var E = Math.E;
|
---|
8 |
|
---|
9 | var FORCED = fails(function () {
|
---|
10 | // eslint-disable-next-line es/no-math-sinh -- required for testing
|
---|
11 | return Math.sinh(-2e-17) != -2e-17;
|
---|
12 | });
|
---|
13 |
|
---|
14 | // `Math.sinh` method
|
---|
15 | // https://tc39.es/ecma262/#sec-math.sinh
|
---|
16 | // V8 near Chromium 38 has a problem with very small numbers
|
---|
17 | $({ target: 'Math', stat: true, forced: FORCED }, {
|
---|
18 | sinh: function sinh(x) {
|
---|
19 | return abs(x = +x) < 1 ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (E / 2);
|
---|
20 | }
|
---|
21 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.