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