MCPcopy Create free account
hub / github.com/melonjs/melonJS / nextPowerOfTwo

Function nextPowerOfTwo

packages/melonjs/src/math/math.ts:66–75  ·  view source on GitHub ↗
(val: number)

Source from the content-addressed store, hash-verified

64 * @returns next power of two relative to the given number
65 */
66export function nextPowerOfTwo(val: number) {
67 val--;
68 val |= val >> 1;
69 val |= val >> 2;
70 val |= val >> 4;
71 val |= val >> 8;
72 val |= val >> 16;
73 val++;
74 return val;
75}
76
77/**
78 * Converts an angle in degrees to an angle in radians

Callers 2

setTextMethod · 0.90
toCanvasMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected