shim.js 206 B

1234567891011
  1. 'use strict';
  2. var exp = Math.exp;
  3. module.exports = function (x) {
  4. if (isNaN(x)) return NaN;
  5. x = Number(x);
  6. if (x === 0) return 1;
  7. if (!isFinite(x)) return Infinity;
  8. return (exp(x) + exp(-x)) / 2;
  9. };