Math.log2 ![Version Badge](https://camo.githubusercontent.com/6168c7d99a88195fc3199134b519cc59c7fc2cb13fb1beffd3cc88e22138998d/68747470733a2f2f76657273696f6e626164672e65732f65732d7368696d732f4d6174682e6c6f67322e737667)
An ESnext spec-compliant Math.log2
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.log2
Usage/Examples
console.log(Math.log2(3)); // 1.584962500721156
console.log(Math.log2(2)); // 1
console.log(Math.log2(1)); // 0
console.log(Math.log2(0)); // -Infinity
console.log(Math.log2(-2)); // NaN
console.log(Math.log2(1024)); // 10
Tests
Simply clone the repo, npm install
, and run npm test