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

Function MostSignificantBitCT

util/generic/bitops.h:320–322  ·  view source on GitHub ↗

* Returns 0 - based position of the most significant bit (compile time) * 0 for 0. */

Source from the content-addressed store, hash-verified

318 * 0 for 0.
319 */
320constexpr ui64 MostSignificantBitCT(ui64 x) {
321 return x > 1 ? 1 + MostSignificantBitCT(x >> 1) : 0;
322}
323
324/*
325 * Return rounded up binary logarithm of `x`.

Callers 1

Y_UNIT_TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected