es-shims / Math.hypot

An ES-spec-compliant Math.hypot shim/polyfill/replacement that works as far down as ES3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Math.hypot Version Badge

dependency status dev dependency status License Downloads

npm badge

An ESnext spec-compliant Math.hypot 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.

Getting started

npm install --save math.hypot

Usage/Examples

console.log(Math.hypot(3, 4)); // 5
console.log(Math.hypot(5, 7)); // 8.602325267042627
console.log(Math.hypot(2, 3, 6)); // 7
console.log(Math.hypot(-5)); // 5

Tests

Simply clone the repo, npm install, and run npm test

About

An ES-spec-compliant Math.hypot shim/polyfill/replacement that works as far down as ES3

License:MIT License


Languages

Language:JavaScript 100.0%