MCPcopy Create free account
hub / github.com/ChartGPU/ChartGPU / nextPow2

Function nextPow2

src/renderers/createPieRenderer.ts:42–46  ·  view source on GitHub ↗
(v: number)

Source from the content-addressed store, hash-verified

40const clampInt = (v: number, lo: number, hi: number): number => Math.min(hi, Math.max(lo, v | 0));
41
42const nextPow2 = (v: number): number => {
43 if (!Number.isFinite(v) || v <= 0) return 1;
44 const n = Math.ceil(v);
45 return 2 ** Math.ceil(Math.log2(n));
46};
47
48const wrapToTau = (thetaRad: number): number => {
49 if (!Number.isFinite(thetaRad)) return 0;

Callers 2

prepareFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected