⚠️ This package is not published onnpm
, because it depends on https://github.com/es-shims/Math.expm1 which is not published yet.
An ESnext spec-compliant Math.tanh
shim/polyfill/replacement that works as far down as ES3.
This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.
npm install --save math.tanh
console.log(Math.tanh(0)); // 0
console.log(Math.tanh(Infinity)); // 1
console.log(Math.tanh(1)); // 0.7615941559557649
Simply clone the repo, npm install
, and run npm test