|
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:
510 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 | var $ = require('../internals/export');
|
|---|
| 3 | var expm1 = require('../internals/math-expm1');
|
|---|
| 4 |
|
|---|
| 5 | // eslint-disable-next-line es/no-math-cosh -- required for testing
|
|---|
| 6 | var $cosh = Math.cosh;
|
|---|
| 7 | var abs = Math.abs;
|
|---|
| 8 | var E = Math.E;
|
|---|
| 9 |
|
|---|
| 10 | var FORCED = !$cosh || $cosh(710) === Infinity;
|
|---|
| 11 |
|
|---|
| 12 | // `Math.cosh` method
|
|---|
| 13 | // https://tc39.es/ecma262/#sec-math.cosh
|
|---|
| 14 | $({ target: 'Math', stat: true, forced: FORCED }, {
|
|---|
| 15 | cosh: function cosh(x) {
|
|---|
| 16 | var t = expm1(abs(x) - 1) + 1;
|
|---|
| 17 | return (t + 1 / (t * E * E)) * (E / 2);
|
|---|
| 18 | }
|
|---|
| 19 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.