MCPcopy Create free account
hub / github.com/catboost/catboost / IsPowerOf2

Function IsPowerOf2

util/generic/bitops.h:219–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217 */
218template <typename T>
219Y_CONST_FUNCTION constexpr bool IsPowerOf2(T v) noexcept {
220 return v > 0 && (v & (v - 1)) == 0;
221}
222
223/**
224 * Returns the number of leading 0-bits in `value`, starting at the most significant bit position.

Callers 6

Y_UNIT_TESTFunction · 0.70
GetPageSizeMethod · 0.50
AlignDownFunction · 0.50
AlignUpSpaceFunction · 0.50
AlignMethod · 0.50
AlignMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected