UNPKG

locutus

Version:

Locutus other languages' standard libraries to JavaScript for fun and educational purposes

14 lines (13 loc) 430 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.tanh = tanh; function tanh(x) { // discuss at: https://locutus.io/ruby/Math/tanh/ // parity verified: Ruby 3.3 // original by: Kevin van Zonneveld (https://kvz.io) // example 1: tanh(0) // returns 1: 0 // example 2: tanh(1) // returns 2: 0.7615941559557649 return Math.tanh(x); }