]> git.r.bdr.sh - rbdr/dotfiles/blob
f9062bd976c693045bf93fd50cd33b76c531162d
[rbdr/dotfiles] /
1 'use strict';
2
3 var exp = Math.exp;
4
5 module.exports = function (x) {
6 if (isNaN(x)) return NaN;
7 x = Number(x);
8 if (x === 0) return 1;
9 if (!isFinite(x)) return Infinity;
10 return (exp(x) + exp(-x)) / 2;
11 };