Skip to content

Documentation / base / isPowerOf2

Function: isPowerOf2()

isPowerOf2(value): boolean

Defined in: libs/base/src/math/misc.ts:47

Check if a number is a power of 2.

Parameters

value

number

The number to be checked.

Returns

boolean

true if the number is a power of 2, otherwise false.

Released under the MIT License.