UNPKG

338 BJavaScriptView Raw
1'use strict';
2var $ = require('../internals/export');
3
4var floor = Math.floor;
5var log = Math.log;
6var LOG2E = Math.LOG2E;
7
8// `Math.clz32` method
9// https://tc39.es/ecma262/#sec-math.clz32
10$({ target: 'Math', stat: true }, {
11 clz32: function clz32(x) {
12 var n = x >>> 0;
13 return n ? 31 - floor(log(n + 0.5) * LOG2E) : 32;
14 }
15});