MCPcopy
hub / github.com/KilledByAPixel/LittleJS / nearestPowerOfTwo

Function nearestPowerOfTwo

src/engineMath.js:203–203  ·  view source on GitHub ↗

Returns the nearest power of two not less than the value * @param {number} value * @return {number} * @memberof Math

(value)

Source from the content-addressed store, hash-verified

201 * @return {number}
202 * @memberof Math */
203function nearestPowerOfTwo(value) { return 2**ceil(log2(value)); }
204
205/** Returns true if two axis aligned bounding boxes are overlapping
206 * this can be used for simple collision detection between objects

Callers 1

math.test.mjsFile · 0.90

Calls 1

log2Function · 0.85

Tested by

no test coverage detected