MCPcopy Create free account
hub / github.com/Effect-TS/effect / nextPow2

Function nextPow2

packages/effect/src/Number.ts:690–693  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

688 * @since 2.0.0
689 */
690export const nextPow2 = (n: number): number => {
691 const nextPow = Math.ceil(Math.log(n) / Math.log(2))
692 return Math.max(Math.pow(2, nextPow), 2)
693}
694
695/**
696 * Parses a `number` from a `string` safely using the `Number()` function.

Callers 1

makeAtomicBoundedFunction · 0.90

Calls 1

logMethod · 0.65

Tested by

no test coverage detected