es.math.log2.js 242 B

123456789101112
  1. var $ = require('../internals/export');
  2. var log = Math.log;
  3. var LN2 = Math.LN2;
  4. // `Math.log2` method
  5. // https://tc39.es/ecma262/#sec-math.log2
  6. $({ target: 'Math', stat: true }, {
  7. log2: function log2(x) {
  8. return log(x) / LN2;
  9. }
  10. });