Next Power Of Two

Pure
NextPowerOfTwo

Returns the smallest power of two >= Value.

Type: Pure (no side effects)
Category: Fortuna|Math & Numeric
Keywords: math & numeric

Inputs

NameTypeDefaultDescription
ValueintValue parameter

Outputs

NameTypeDescription
ReturnValueintReturnValue output

Example Use Cases

Example 1

Round up a render target size to power-of-two.

Example 2

Allocate properly sized buffers.