30 lines
760 B
JavaScript
30 lines
760 B
JavaScript
shadow$provide.module$node_modules$pixi_DOT_js$lib$maths$misc$pow2 = function(global, require, module, exports) {
|
|
exports.isPow2 = function(v) {
|
|
return !(v & v - 1) && !!v;
|
|
};
|
|
exports.log2 = function(v) {
|
|
let r = (65535 < v ? 1 : 0) << 4;
|
|
v >>>= r;
|
|
let shift = (255 < v ? 1 : 0) << 3;
|
|
v >>>= shift;
|
|
r |= shift;
|
|
shift = (15 < v ? 1 : 0) << 2;
|
|
v >>>= shift;
|
|
r |= shift;
|
|
shift = (3 < v ? 1 : 0) << 1;
|
|
v >>>= shift;
|
|
return r | shift | v >> 1;
|
|
};
|
|
exports.nextPow2 = function(v) {
|
|
v += 0 === v ? 1 : 0;
|
|
--v;
|
|
v |= v >>> 1;
|
|
v |= v >>> 2;
|
|
v |= v >>> 4;
|
|
v |= v >>> 8;
|
|
return (v | v >>> 16) + 1;
|
|
};
|
|
};
|
|
|
|
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$maths$misc$pow2.js.map
|