MCPcopy Create free account
hub / github.com/avast/retdec / bitSizeOfNumber

Function bitSizeOfNumber

src/utils/math.cpp:26–32  ·  view source on GitHub ↗

* @brief Returns the number of bits needed to encode the given number. */

Source from the content-addressed store, hash-verified

24* @brief Returns the number of bits needed to encode the given number.
25*/
26unsigned bitSizeOfNumber(unsigned long long v) {
27 unsigned int r = 0;
28 while (v >>= 1) {
29 r++;
30 }
31 return r + 1;
32}
33
34} // namespace utils
35} // namespace retdec

Callers 1

TEST_FFunction · 0.85

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.68