isPowerOf2

Power of 2 test. T should be an uinteger type

bool
isPowerOf2
(
T
)
(
T arg
)

Parameters

arg T

an integer value

Return Value

Type: bool

true iff arg is 2^n for some n > 0

Meta