summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cosh/shim.js
blob: f9062bd976c693045bf93fd50cd33b76c531162d (plain)
1
2
3
4
5
6
7
8
9
10
11
'use strict';

var exp = Math.exp;

module.exports = function (x) {
	if (isNaN(x)) return NaN;
	x = Number(x);
	if (x === 0) return 1;
	if (!isFinite(x)) return Infinity;
	return (exp(x) + exp(-x)) / 2;
};