carb::math::isPowerOf2

Defined in carb/math/Util.h

template<class T>
constexpr bool carb::math::isPowerOf2(const T &val)

Returns whether the given integer value is a power of two.

Parameters

val[in] The non-zero integer value. Negative numbers are treated as unsigned values.

Returns

true if the integer value is a power of two; false otherwise. Undefined behavior arises if val is zero.