locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
17 lines (16 loc) • 565 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.cosh = cosh;
function cosh(x) {
// discuss at: https://locutus.io/python/cosh/
// parity verified: Python 3.12
// original by: Kevin van Zonneveld (https://kvz.io)
// note 1: Returns the hyperbolic cosine of x
// example 1: cosh(0)
// returns 1: 1
// example 2: cosh(1)
// returns 2: 1.5430806348152437
// example 3: cosh(-1)
// returns 3: 1.5430806348152437
return Math.cosh(x);
}