src/util/WWMath.js
function (value) {
                var power = Math.floor(Math.log(value) / Math.log(2));
                return Math.pow(2, power);
            }
function (value) {
                var power = Math.floor(Math.log(value) / Math.log(2));
                return Math.pow(2, power);
            }
function ( value ) { var power = Math . floor ( Math . log ( value ) / Math . log ( 2 ) ) ; return Math . pow ( 2 , power ) ; }
Returns the value that is the nearest power of 2 less than or equal to the given value.
@param {Number} value the reference value. The power of 2 returned is less than or equal to this value.
@returns {Number} the value that is the nearest power of 2 less than or equal to the reference value
Returns the value that is the nearest power of 2 less than or equal to the given value .